# 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" )
Run the code above in your browser using DataLab