When using officedown::rdocx_document
in R Mardown, the Office Word output will include the plots as a .jpg image although my desire is to automatically include the plots of my R markdown in format .emf (Enhanched Metafile).
I know that with the function ggsave()
you can adapt the device to .emf like in this example:
plot(mtcars$mpg)
ggsave("plot.emf", width = 10, height = 6, scale = 1, device = {function(filename, ...) devEMF::emf(file = filename, ...)})
Is there a way to do a workaround ggsave
to change the device output of the plots in a RMarkdown (.Rmd) using officedown::rdocx_document as the output?