[R] Loading .Rdata within an R function

Giles Crane gilescrane at verizon.net
Thu Jul 8 21:21:13 CEST 2010


Colleagues:

I am having trouble loading data from within .Rdata file
within the environment of a function.  That is,
the following always loads to the global environment:

   f1 <- function()    {

           load("mydata.Rdata")

           #  compute with objects from mydata.Rdata.

           }

I wish to load mydata.Rdata only within the function f1.
Perhaps I have misunderstood the capabilities of load(),
or the environment concepts.

Thank you for any help you may give.
Cordially,
Giles Crane

-- 
View this message in context: http://r.789695.n4.nabble.com/Loading-Rdata-within-an-R-function-tp2282751p2282751.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list