I am aware that it is easily possible to create var names on the fly. e.g.
assign(paste("m",i,sep=""),j)
but is it possible to assign dataframes to variables created on the fly?

e.g. 
If I have a dataframe called master and I wanted to subset parts of those
data into separate dataframes, I could do:

m1=subset(master,master$SAMPLE=='1')
m2=subset(master,master$SAMPLE=='2')
.....

but I would like to do this in a loop. Can someone give me suggestions on
how to accomplish this?


I tried assign(paste("m",i,sep=""),subset(master,master$SAMPLE==i) with no
success.


thanks! 

-- 
View this message in context: 
http://www.nabble.com/Creating-dataframe-names-on-the-fly--tp22631171p22631171.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to