My .Rmd file becomes very lengthy. Is that possible split it and source() it's smaller portions from main .Rmd?

a 夏天 提交于 2020-11-29 10:34:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!