user3022875
user3022875

Reputation: 9018

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

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

Upvotes: 8

Views: 3791

Answers (1)

Sébastien Rochette
Sébastien Rochette

Reputation: 6661

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"
)

Upvotes: 8

Related Questions