Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread David Winsemius
On Mar 2, 2010, at 8:11 AM, Sebastian Bauer wrote: Hello, is there an elegant way, how I can convert each row of a data frame into distinct elements of a list? split(dfrm, rownames(dfrm)) In essence, what I'm looking for is something like rows.to.lists <- function( df ) { ll <-

Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread Sebastian Bauer
Hi! On 03/02/2010 02:22 PM, Nutter, Benjamin wrote: as.data.frame(t(df)) For example x<- as.data.frame(t(mtcars)) typeof(x) [1] "list" Thanks for the quick reply! I would never have guessed that as.data.frame() works that way! BTW This one seems also to do the trick: rows.to.list <- f

Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread Nutter, Benjamin
> as.data.frame(t(df)) For example > x <- as.data.frame(t(mtcars)) > typeof(x) [1] "list" -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sebastian Bauer Sent: Tuesday, March 02, 2010 8:12 AM To: r-help@r-project.org Subject: [R]