Re: [R] Sweave with external R code

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Thu, 24 Jun 2010 15:14:40 -0400

On 24/06/2010 3:00 PM, Gaston Fiore wrote:
> Hello,
>
> I'm new to R and Sweave and I was wondering whether you can just include all your R code in external files and then call them from within the code chunks. I've read the Sweave User Manual but I couldn't find any specific information about this. Is this not customarily done?

Normally the idea is that the Sweave document is self-contained, so you wouldn't do this. However, you would often put a lot of your code into a package, and then attach the package early in the Sweave document. It's also possible to use source() in a code chunk.

Duncan Murdoch



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 Jun 2010 - 19:17:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jun 2010 - 19:40:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive