Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rmarkdown::render output dir and output file DO NOT work

Tags:

r-markdown

I am using render to produce a pdf:

rmarkdown::render("C://Users//myrmd.Rmd")

that works but when I add an output file and directory it does not work:

rmarkdown::render("C://Users//myrmd.Rmd",
output_file="C://...//myfolder//mypdf.pdf),
output_dir="C://.....//myfolder))

this returns an error Error: pandoc document conversion failed with error 43

Can you advise what the issue is here?

I have rmarkdown v1.8

like image 269
user3022875 Avatar asked Dec 15 '17 19:12

user3022875


1 Answers

The output_file is only for the name of the file. Not the path.
You also have too many parenthesis.
Try with:

rmarkdown::render(
  "C:/Users/myrmd.Rmd",
  output_file = "mypdf.pdf",
  output_dir = "C:/...../myfolder"
)
like image 80
Sébastien Rochette Avatar answered Oct 09 '22 13:10

Sébastien Rochette