My .Rmd file becomes very lengthy.
Is that possible to split it into several small .Rmd files and then source them somehow from main Rmd file (as we source()
R files)?
Asked
Active
Viewed 409 times
2

IVIM
- 2,167
- 1
- 15
- 41
-
2Maybe something like [child documents](https://yihui.name/knitr/demo/child/)? – aosmith May 08 '19 at 21:49
2 Answers
3
The comment above provided elegant solution, as simple as including these lines - they will incluide your child Rmd files into your main Rmd file.
```{r includeEndingPart, child = 'part-7-End.Rmd'}
```
```{r includeFAQ, child = 'part-8-FAQ.Rmd'}
```
NB: I noted also that you cannot do it from inside child Rmd files.

IVIM
- 2,167
- 1
- 15
- 41
0
I think this SO discussion has a nice answer to your question, using purl()
and source()
.

Felix T.
- 520
- 3
- 11