[R] R modules

Duncan Murdoch murdoch at stats.uwo.ca
Tue Jan 2 19:37:02 CET 2007


On 1/2/2007 12:46 PM, Geoffrey Zhu wrote:
> Hi All,
> 
> I'd like to know what is the best way to organize R code in multiple modules=
>  and files. The R code we are writing is too much for a single file. Besides=
> , there are a lot of reusable functions we'd like to factor out. But writing=
>  a package for that is quite an over-kill and might be too inflexible. 
> 
> So what is the best way to organize R code into multiple files and reusable=
>  modules?

Write a package for it.  It's not overkill, it's using the tools the way 
they were designed to be used.

Not all packages need to be submitted to CRAN, you can have a package 
for your own use.  It gives you a way to organize your code and 
documentation, numerous code checking tools, namespaces, all sorts of 
good stuff.

Duncan Murdoch



More information about the R-help mailing list