Re: [R] List of lists to data frame?

2011-11-17 Thread Bert Gunter
: Re: [R] List of lists to data frame? unlist(..., recursive = F) Michael On Wed, Nov 16, 2011 at 6:20 PM,  rkevinbur...@charter.net wrote: I would like to make the following faster:        df - NULL        for(i in 1:length(s))        {                df - rbind(df, cbind(names(s[i

[R] List of lists to data frame?

2011-11-16 Thread rkevinburton
I would like to make the following faster: df - NULL for(i in 1:length(s)) { df - rbind(df, cbind(names(s[i]), time(s[[i]]$series), as.vector(s[[i]]$series), s[[i]]$category)) } names(df) - c(name, time, value, category) return(df)

Re: [R] List of lists to data frame?

2011-11-16 Thread R. Michael Weylandt
unlist(..., recursive = F) Michael On Wed, Nov 16, 2011 at 6:20 PM, rkevinbur...@charter.net wrote: I would like to make the following faster:        df - NULL        for(i in 1:length(s))        {                df - rbind(df, cbind(names(s[i]), time(s[[i]]$series),

Re: [R] List of lists to data frame?

2011-11-16 Thread Kevin Burton
to the master data frame but like I said it is *very* slow. Kevin -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Wednesday, November 16, 2011 5:26 PM To: rkevinbur...@charter.net Cc: r-help@r-project.org Subject: Re: [R] List of lists to data frame? unlist

Re: [R] List of lists to data frame?

2011-11-16 Thread Sarah Goslee
, 2011 5:26 PM To: rkevinbur...@charter.net Cc: r-help@r-project.org Subject: Re: [R] List of lists to data frame? unlist(..., recursive = F) Michael On Wed, Nov 16, 2011 at 6:20 PM,  rkevinbur...@charter.net wrote: I would like to make the following faster:        df - NULL

Re: [R] List of lists to data frame?

2011-11-16 Thread christiaan pauw
On the face of it this looks like a job for ldply() in the plyr package which specialises in taking things apart and putting them back together. ldply() applies a function for each element of a list and then combine results into a data frame On 17 November 2011 04:53, Sarah Goslee