| 1 |
You can also use the `child` option to include child documents in markdown. |
| 2 |
|
| 3 |
```{r test-main, child='knitr-child.Rmd'} |
| 4 |
``` |
| 5 |
|
| 6 |
You can continue your main document below, of course. |
| 7 |
|
| 8 |
```{r test-another} |
| 9 |
pmax(1:10, 5) |
| 10 |
``` |
| 11 |
|
| 12 |
If you refer to a child document in a chunk, only the child document will be evaluated. |
| 13 |
Other code in the chunk will not be evaluated when you `render` the document. |
| 14 |
|
| 15 |
```{r test-warning-option, include=FALSE} |
| 16 |
options(knitr.child.warning = FALSE) |
| 17 |
``` |
| 18 |
|
| 19 |
```{r test-warning, child='knitr-child2.Rmd'} |
| 20 |
x <- "this code is not evaluated" |
| 21 |
x |
| 22 |
``` |