Is there a YAML option, which sets knit directory for an Rmd file? I.e. does the same as illustrated in Fig.1. The problem is that every time I copy files or share a project with other people (which usually have different default RStudio options than I do), the knit directory should be reset manually in each file. I'm aware of the global option (Fig.2), but I need a more reproducible solution which works for individual Rmd files in both both RStudio notebook and knitting modes. And, for instance, I know that there is an option such as:
editor_options:
chunk_output_type: console
Any ideas?
Fig. 1 Setting knit directory via menu commands.
Fig. 2 Global option to set default knit directory in RStudio.
You could try to specify the knit
field in the front-matter of our .Rmd file. Example .Rmd that would knit into "some_dir" created in your home directory:
---
title: "Untitled"
output: html_document
knit: (function(inputFile, encoding) {
rmarkdown::render(inputFile, encoding = encoding, output_dir = "~/some_dir/")
})
---
# Some content
Some content
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With