[R] Convert list of lists -- data frame

2008-07-23 Thread Michael Friendly
For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how. pats - list(structure(list(shape = 0, shape.col = black, shape.lty = 1, cell.fill = white, back.fill = white, label = 1,

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Henrique Dallazuanna
Try this: pats.df - do.call(rbind, pats) On Wed, Jul 23, 2008 at 10:23 AM, Michael Friendly [EMAIL PROTECTED] wrote: For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how.

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Patrizio Frederic
try ?unlist it may help regards +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 | fax: +39 059

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Jorge Ivan Velez
Dear Michael, Perhaps, data.frame(do.call(rbind,lapply(pats,function(x) t(as.matrix(x,ncol=10) HTH, Jorge On Wed, Jul 23, 2008 at 9:23 AM, Michael Friendly [EMAIL PROTECTED] wrote: For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Henrique Dallazuanna
Oh, you are rigth Marc, thanks. Another option is: pats.df - do.call(rbind.data.frame, pats) On Wed, Jul 23, 2008 at 1:10 PM, Marc Schwartz [EMAIL PROTECTED] wrote: on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: Try this: pats.df - do.call(rbind, pats) Henrique, Take note of the