[R] write data frame in a list

Grzes gregorio99 at gmail.com
Tue Nov 10 12:05:20 CET 2009


Hi,
I have got a data frame:

df=data.frame(x=c(3,6,7),y=c(2,7,4))

and I would like to write my values from data frame to list using loop, for
example:

lista=list()
for (i in 1: length(?)){
        lista[[?]][?] = df [?]
}
But I havn't got any idea what I should put in places where I put a question
mark?  

As a rusult I would like to get a list like this:
list:
[[1]]
3,6,7
[[2]]
2,7,4

I wll be very happy if somebody can help me


-- 
View this message in context: http://old.nabble.com/write-data-frame-in-a-list-tp26281645p26281645.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list