0

It is possible to create a website with several rmarkdown files. For each rmarkdown file, we can specify some global options like:

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message=FALSE, warning=FALSE)
```

If I want to apply all these options to all rmd files, I can put the same code in each file.

I would like to know if it is possible to put this code somewhere so that it can be shared to every rmd files. In fact, sometimes, I want to make some change (for example set echo = TRUE), and I want to do it once for the entire website.

John Smith
  • 1,604
  • 4
  • 18
  • 45
  • Possible duplicate of [How to combine two RMarkdown (.Rmd) files into a single output?](http://stackoverflow.com/questions/25824795/how-to-combine-two-rmarkdown-rmd-files-into-a-single-output) – scoa Nov 06 '16 at 10:07

1 Answers1

4

You can include a child document

```{r, child="_setup.Rmd"}
```

at the beginning of each rmd file.

bergant
  • 7,122
  • 1
  • 20
  • 24