Dear List:

It appears that simulating data where all dataframes are stored as a
list will only work for relatively small analyses. Instead, it appears
that creating N individual dataframes, saving them, and loading them
when needed is the best way to save memory and make this a feasible
task.

As such, I now have a new(er) question with respect to dealing with
individual files within a loop. To begin, I construct 250 individual
data files as follows:

library(MASS)
Sigma<-matrix(c(400,80,80,80,80,400,80,80,80,80,400,80,80,80,80,400),4,4
) 
mu<-c(100,150,200,250) 
sample.size<-5000
N=250 #Number of dataframes 

# Step 1 Create dataframes
for(i in 1:N) 
{ 
assign(paste("Data.", i, sep=''), 
as.data.frame(cbind(seq(1:sample.size),(mvrnorm(n=sample.size, mu,
Sigma))))) 
} 


My goal is to now save each file, remove them from memory, and load each
file individually, run it through a linear model, and save the output.

To attempt to save each file I try

for (i in 1:N) {
save(paste("Data.", i, sep=""), file=paste("Data.",i, ".Rdata", sep=""))

}

Which gives me an error message. It essentially states that Object
"paste("Data.", i, sep = "")" not found

I'm not quite sure what I am doing wrong here. 

The other issue I am encountering is how to best work with an object in
a loop. I get the following to work, but I'm not sure if this is the
best method for doing so. 

for(i in 1:N){
assign(paste("out.",i,sep=""),
lm((get(paste("Data.",i,sep=""))[["V3"]])~(get(paste("Data.",i,sep=""))[
["V2"]])))
}

Thank you for your help as I work through this,
Harold

	[[alternative HTML version deleted]]


