[R] Good Programming Practice Question - Functions in Different Files

Jason Rupert jasonkrupert at yahoo.com
Mon Jun 8 22:30:46 CEST 2009


I've gotten to the point wih an R script where I would like to encapsulate several blocks of codes in R functions.

In order to keep the top level script simple I would like to put them in a separate file.  This should help the readability of the top level main script.

Is source(...) the best way to load those functions in the top level script?  

For example, in the top level script
Line#
01  source("FunctionsFile.R")
02
03  callfunctionfromfunctionfile(...)

Thanks for any feedback and insights. 

Also, I found the following:
http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node71.html

But are there other guides out there that speak to good practices when developing in R?




More information about the R-help mailing list