Hi Brendan,
If you really, really want to work with the for() loop, then
for(i in 1:10){
assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250
assign(paste("theta2_",i,sep=""),data.frame(scale(rnorm(250
assign(paste("theta3_",i,sep=""), get(paste("
Brendan,
I think you should create objects outside of the "for" loop. You can't
create objects instide the loop. You can try this:
metalist1<-list()
for(i in 1:10)
{metalist1[[i]]<-assign(paste("theta1_",i,sep=""),data.frame(scale(rnorm(250}
lapply(metalist1,function(x){print(dim(x))}) # Che
On 4/20/2009 2:35 PM, Brendan Morse wrote:
Hi everyone, I am trying to calculate a particular variable (vector) from
some previously defined variables in a loop but I am having trouble figuring
out how to get the loop to recognize that it should index for the previously
defined objects. Here is a
Hi everyone, I am trying to calculate a particular variable (vector) from
some previously defined variables in a loop but I am having trouble figuring
out how to get the loop to recognize that it should index for the previously
defined objects. Here is a simplified version of what I am trying to do
4 matches
Mail list logo