Print the sourced R file to an appendix using Sweave
I keep R and Rnw files separate, then load the R data/plots with load("file.R") in the first Sweave chunk. Is there a way that I can print the sourced R file to an appendix without executing all of the code? (i.e., the code is slow enough that I don't want to source() it in an echo=TRUE chunk). Thanks! Update -- actually, I don't think my source() idea works. How about using a Latex package? Add into your header \usepackage{fancyvrb} Then \VerbatimInput{yourRfile.R} You can use highlight package to output nicely formatted, colorful code: highlight("myRfile.R", renderer = renderer_latex