[R] Rmarkdown / knitr naming the output file

Rainer Hurling
Sun, 12 Jul 2015 14:39:37 -0000

Am 06.07.2015 um 14:24 schrieb AURORA GONZALEZ VIDAL:
> Hello.
> I have a question for Rmarkdown users.
>
> Is there any way to give a name to the output document inside the Rmd?
>
> For example, my rmd's name is "bb.Rmd" but when I knitr to
pdf I want it to
> name the pdf differently than "bb.pdf", for example,
"doc1.pdf". Is there
> any way to do this?

Here is another way of changing the output filename. I am using it from
R's commandline:

rmarkdown::render(
  input="filename_orig.R",
  output_format="pdf_document",
  output_file="filename_different.pdf"
)

Greetings,
Rainer Hurling