ReporteRs (version 0.5.2)

addImage.docx: Insert external images into a docx object

Description

Add external images into a "docx" object.

Usage

# S3 method for docx
addImage(doc, filename, width = 6, height = 6, bookmark,
  parStyle = parProperties(text.align = "center", padding = 5), ...)

Arguments

doc

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

filename

"character" value, complete filenamed of the external images

width

images width in inches (default value is 6).

height

images height in inches (default value is 6).

bookmark

a character value ; id of the Word bookmark to replace by the image. optional. if missing, image is added at the end of the document.

parStyle

paragraph formatting properties of the paragraph that contains images. An object of class parProperties

...

further arguments, not used.

Value

an object of class "docx".

See Also

docx, addPlot.docx , addImage

Examples

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

# 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 )

# Write the object in file "addImage_example.docx"
writeDoc( doc, "addImage_example.docx" )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace