ReporteRs (version 0.5.3)

addImage.pptx: Insert an external image into a pptx object

Description

Add an external image into a "pptx" object.

Usage

# S3 method for pptx
addImage(doc, filename, ...)

Arguments

doc

Object of class "pptx" where external image has to be added

filename

"character" value, complete filename of the external image

...

further arguments, not used.

Value

an object of class "pptx".

Details

image is added to the next free 'content' shape of the current slide. See slide.layouts.pptx to view the slide layout.

See Also

pptx, addPlot.pptx , addImage

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
# Create a new document
doc = pptx( title = "title" )

# add a slide with layout "Title and Content" then add an image
doc = addSlide( doc, slide.layout = "Title and Content" )

# the file 'logo.jpg' only exists in R for Windows
img.file = file.path( Sys.getenv("R_HOME"), "doc", "html", "logo.jpg" )
doc = addImage(doc, img.file )

writeDoc( doc, "addImage_example.pptx" )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace