New Location

new_location(ph_location_fn, ...)

Arguments

ph_location_fn

function. Function in the officer::ph_location* family

...

args to pass to ph_location_fn

Value

An object of class R2PptxLocation representing the location to place an R2PptxElement.

See also

Examples

# create an element with some text offset 2 from the left and 2 from the top
# of the slide
element_location <- new_location(officer::ph_location, left = 2, top = 2)
element <- new_element(
  key = element_location,
  value = "Some text"
)
presentation <- new_presentation() +
  new_slide("Title Slide", elements = list(element))
path <- tempfile(fileext = ".pptx")
write_pptx(presentation, path)
if (interactive()) browseURL(path)