问题
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)?
回答1:
I think this SO discussion has a nice answer to your question, using purl()
and source()
.
回答2:
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.
来源:https://stackoverflow.com/questions/56049459/my-rmd-file-becomes-very-lengthy-is-that-possible-split-it-and-source-its-s