Split from the original thread: Generating downloadable reports (rmarkdown) : reference_docx (yaml header) is not read by knitr
have tried using
word_document()
and absolute paths as suggested above, but this has made no difference.It is odd because it works as expected on rstudio server but not shiny server; even though they are running on the same machine.
I am using absolute paths in with temporary folders, so
/tmp/RtmpnWjfwF/oGLv9Kz/template.docx
. Could this be causing a problem? Both.Rmd
andtemplate.docx
are in the same temporary folder.
thanks for the quick reply, unfortunately I am still getting the same behaviour. So, style works fine on rstudioserver but not once deployed to shinyserver. This is all running on an Ubuntu machine, but both servers are using the same system R install.
I have included below the error message I get from word (not very informative) and the render
and yaml
code chucks. Any further suggestions or advice would be greatly aprpeciated.
rmarkdown::render("/tmp/RtmpnWjfwF/YY7KrNO/report.Rmd",
'word_document',
knit_root_dir = "/tmp/RtmpnWjfwF/YY7KrNO",
output_file = file,
clean = FALSE,
params = params,
envir = new.env(parent = globalenv())
)
And the yaml:
---
output:
word_document:
reference_docx: photo_log_template.docx
params:
organisation: NA
photographer: NA
df: NA
---
thanks again
Matt