# NOT RUN {
img.file <- file.path( R.home("doc"), "html", "logo.jpg" )
if( file.exists(img.file) ){
# create a example file to be inserted later in the final doc----
doc <- read_docx()
doc <- body_add_img(x = doc, src = img.file, height = 1.06, width = 1.39 )
print(doc, target = "external_file.docx")
# insert external_file.docx in the final doc----
final_doc <- read_docx()
doc <- body_add_docx(x = doc, src = "external_file.docx" )
print(doc, target = "final.docx")
}
# }
Run the code above in your browser using DataCamp Workspace