[R] for (i in ...) { df[[i]]<- .....}

Luis Rideau Cruz Luisr at frs.fo
Fri Aug 27 15:11:31 CEST 2004


R-help,

In the following loop :

for(i in 1:8)
{
cc[[i]]<-tapply(test[,i+6],list(puntar=test$puntar),sum)/tapply(test[,5],list(puntar=test$puntar),sum)

cbind.data.frame(cc[[1]],cc[[2]],cc[[3]],cc[[4]],
cc[[5]],c[[6]],cc[[7]],cc[[8]])

}

Is there anyway I can 'cbind.data.frame' the objects cc[[ i ]] without
actually writing every single element??
In this case there are 8 but what if it is a large number??


Thank you




More information about the R-help mailing list