[R] Loading functions in R

Christos Hatzis christos at nuverabio.com
Thu Feb 1 05:46:54 CET 2007


The recommended approach is to make a package for your functions that will
include documentation, error checks etc.
Another way to accomplish what you want is to start a new R session and
'source' your .R files and then to save the workspace in a .RData file, e.g.
myFunctions.RData.

Finally

attach(myFunctions.RData)  

should do the trick without cluttering your workspace.

-Christos

Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
 


-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Forest Floor
Sent: Wednesday, January 31, 2007 10:41 PM
To: r-help at stat.math.ethz.ch
Subject: [R] Loading functions in R

Hi all,

This information must be out there, but I can't seem to find it.  What I
want to do is to store functions I've created (as .R files or in whatever
form) and then load them when I need them (or on startup) so that I can
access without cluttering my program with the function code.  
This seems like it should be easy, but....

Thanks!

Jeff

______________________________________________
R-help at stat.math.ethz.ch 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.



More information about the R-help mailing list