R officer package body_add_img formatting

30 Views Asked by At

I am using the R officer package to generate a word document based on an existing document template. There are locations within the template where imaged are inserted using body_add_img. Here is how I am implementing this within my script:

doc<- doc %>% cursor_reach('FIGURE1HERE')%>% body_add_img(src=paste(box_path, pic_path, sep=''), width=2.1, height=1.4, pos = "on")

The intent is to insert the image where the text FIGURE1HERE occurs within the template, shown here: enter image description here

However, when the image is inserted, the formatting and text are displaced: enter image description here

I tried adjusting both the pos and style arguments, but did not have any luck.

Does anyone know how to utilize body_add_img, or another method, to insert images without disrupting the document formatting, and allowing "wrap-text"? I am open to other package suggestions, however I need to stay within an R environment. If there is any other information needed to answer this question, please ask. Thanks!

0

There are 0 best solutions below