I know this can be done with php and other languages, but was wondering whether the following could be accomplished using knitr:
Let\'s say I have an Rmarkdown (.rmd
that is what the chunk option child
is for, e.g. in second.Rmd
, you can
```{r child='first.Rmd'}
```
that is a little bit trickier, but you can call knit_child()
manually, e.g.
```{r echo=FALSE, results='asis'}
# knit the first three lines of first.Rmd
cat(knit_child(text = readLines('first.Rmd')[1:3]), sep = '\n')
```