ReporteRs (version 0.7.3)

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

Description

Add an external image into a bsdoc object.

Usage

# S3 method for bsdoc
addImage(doc, filename, width, height,
  par.properties = parProperties(text.align = "center", padding = 5), ...)

Arguments

doc

bsdoc object where external image has to be added

filename

"character" value, complete filename of the external image

width

image width in pixel

height

image height in pixel

par.properties

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

...

further arguments, not used.

Value

an object of class bsdoc.

See Also

bsdoc, addPlot.bsdoc , addImage

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
doc.filename = "addImage_bsdoc/example.html"

# set default font size to 11
options( "ReporteRs-fontsize" = 11 )

doc = bsdoc( )
# 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, width = 100, height = 76 )

# Write the object
writeDoc( doc, file = doc.filename )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace