[R] Rmarkdown / knitr naming the output file

Yihui Xie xie at yihui.name
Mon Jul 6 21:24:34 CEST 2015


There is no direct way to get it, but you can get 1) the input
filename via knitr::current_input(), and 2) the output format via
knitr::opts_knit$get('rmarkdown.pandoc.to'). You may be able to figure
out the output filename based on these two pieces of information.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name


On Mon, Jul 6, 2015 at 7:24 AM, AURORA GONZALEZ VIDAL
<aurora.gonzalez2 at um.es> wrote:
> 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?
>
> Thank you very much
>
>
> ------
> Aurora González Vidal
>
> Sección Apoyo Estadístico.
> Servicio de Apoyo a la Investigación (SAI).
> Vicerrectorado de Investigación.
> Universidad de Murcia
> Edif. SACE . Campus de Espinardo.
> 30100 Murcia
>
> @. aurora.gonzalez2 at um.es
> T. 868 88 7315
> F. 868 88 7302
> www.um.es/sai
> www.um.es/ae



More information about the R-help mailing list