Can knitr work with multiple .Rmd files in the same directory?

I use knitr to create markdowns, then convert to html with markdown::markdownToHTML()

knitrwill put the numbers for the .Rmd file in a subdirectory figure/. However, if I process multiple .Rmd files in the same directory, the numbers may be overwritten. Naming each fragment with a unique name in all .Rmd files makes unambiguously named numbers, but this is error prone. Reusing a name will accidentally replace old numbers.

Is there an easy way to use different directories figure/or otherwise separate the numbers for each .Rmd file?

+3
source share
1 answer

Yes you can use:

opts_chunk$set(fig.path = "other_directory")

figure/.

+4

All Articles