Re: [R] Loading .Rdata within an R function

2010-07-09 Thread Duncan Murdoch
Giles Crane wrote: Thank you for your consideration of this question. I have tried both your suggestions. However, the data is not loaded within the function. When I specify load("mydata.Rdata",.globalEnv), the data is loaded into the top level environment, and the function does access the data

Re: [R] Loading .Rdata within an R function

2010-07-09 Thread Giles Crane
Thank you for your consideration of this question. I have tried both your suggestions. However, the data is not loaded within the function. When I specify load("mydata.Rdata",.globalEnv), the data is loaded into the top level environment, and the function does access the data in the top level env

Re: [R] Loading .Rdata within an R function

2010-07-08 Thread Duncan Murdoch
On 08/07/2010 6:21 PM, Duncan Murdoch wrote: On 08/07/2010 3:21 PM, Giles Crane wrote: 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(){

Re: [R] Loading .Rdata within an R function

2010-07-08 Thread Duncan Murdoch
On 08/07/2010 3:21 PM, Giles Crane wrote: 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 w

Re: [R] Loading .Rdata within an R function

2010-07-08 Thread David Winsemius
On Jul 8, 2010, at 3:21 PM, Giles Crane wrote: 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