# NOT RUN {
# Create a new document
doc = docx( title = "title" )
img.file = file.path( Sys.getenv("R_HOME"), "doc", "html", "logo.jpg" )
doc <- addImage(doc, img.file )#work with only windows
# Write the object in file "~/document.docx"
writeDoc( doc, "~/document.docx" )
# }
Run the code above in your browser using DataCamp Workspace