3

Let's say I have (1) a Markdown file with some text and R code (code should not be evaluated, just printed out) and I have (2) an R file with some user-defined functions, which, again, should not be evaluated but only printed out.

Now, I want to combine those two as an RMarkdown article (to place those user-defined function (2) in some kind of Appendix). I know how to include Markdown files (child='FILENAME.md'), but how to include an external R file with syntax highlighting?

Yes, I know, I can just copy the contents of that R file (2) to my main Markdown file (1), add some {r}, and everything will be fine. Except that I still want to keep those two separate...

Is it possible?

A S
  • 1,195
  • 2
  • 12
  • 26

0 Answers0