2

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)?

IVIM
  • 2,167
  • 1
  • 15
  • 41

2 Answers2

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