officer (version 0.3.6)

external_img: external image

Description

This function is used to insert images in 'PowerPoint' slides.

Usage

external_img(src, width = 0.5, height = 0.2)

# S3 method for external_img dim(x)

# S3 method for external_img as.data.frame(x, ...)

# S3 method for external_img format(x, type = "console", ...)

Arguments

src

image file path

width

height in inches

height

height in inches

x

external_img object

...

unused

type

output format

See Also

ph_with

Examples

Run this code
# NOT RUN {
img.file <- file.path( R.home("doc"), "html", "logo.jpg" )

doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(x = doc,
  value = external_img(img.file, width = 1.39, height = 1.06),
  location = ph_location_type(type = "body"),
  use_loc_size = FALSE )
print(doc, target = tempfile(fileext = ".pptx"))
# }

Run the code above in your browser using DataLab