Add or remove content from a slide
Description
content() lets a user specify a value to add to a slide, and the location
on the slide to add it through the ph argument. ph defines the placeholder,
or height, width, x and y offset of the bounding box where the content should
be added.
Usage
content( value, ph = ph_body(), metadata = NULL, ..., group_contents = TRUE, error_call = current_env() ) remove_content(ph, error_call = current_env())content( value, ph = ph_body(), metadata = NULL, ..., group_contents = TRUE, error_call = current_env() ) remove_content(ph, error_call = current_env())
Arguments
value |
value to be polished and then added at the placeholder defined |
ph |
Defining where values should be added to or removed from. Must be a placeholder object |
metadata |
named character vector of metadata to store in the
|
... |
Additional arguments forwarded to the |
group_contents |
boolean indicating if the polished value should be shown in the PowerPoint as a grouped Sp. The default, and for most cases, TRUE. |
error_call |
The execution environment of a currently
running function, e.g. |
Details
remove_content() on the other hand, lets users specify a placeholder with
content that should be removed from the slide using the same placeholder
nomenclature. The placeholder must exist in the slide to be removed.
Any named arguments passed via ... are forwarded to the appropriate
polish::polish_content_pptx() method when the content is rendered into the
slide. The available arguments depend on the class of value.
Value
a powerup_content object for content() and a remove_powerup_content object for remove_content()
See Also
polish::polish_content_pptx() for the full set of polishing
arguments available per content type.
Examples
content("My Title 2", ph = ph_title()) content(mtcars , ph = ph_body()) # Pass polishing args for a ggplot (controls rendered dimensions) content( ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point(), ph = ph_body(), height = 3, width = 5 ) # Pass polishing args for character content (font styling) content("My Title", ph = ph_title(), font_size = 24, font_color = "#C00000") remove_content(ph = ph_title()) remove_content(ph = ref_placeholder(label = "An Existing Placeholder"))content("My Title 2", ph = ph_title()) content(mtcars , ph = ph_body()) # Pass polishing args for a ggplot (controls rendered dimensions) content( ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point(), ph = ph_body(), height = 3, width = 5 ) # Pass polishing args for character content (font styling) content("My Title", ph = ph_title(), font_size = 24, font_color = "#C00000") remove_content(ph = ph_title()) remove_content(ph = ref_placeholder(label = "An Existing Placeholder"))