Skip to content
Back to formatted view

Raw Message

Message-ID: <22631171.post@talk.nabble.com>
Date: 2009-03-21T00:18:23Z
From: science!
Subject: Creating dataframe names on the fly?

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.