[R] Convert list of lists <--> data frame

Ben Bolker bolker at ufl.edu
Wed Jul 23 17:19:38 CEST 2008


Michael Friendly <friendly <at> yorku.ca> writes:

> 
> 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.
> 

  [snip data]




pats.df <- do.call("rbind",pats)
pats2 <- apply(pats.df,1,as.list)
identical(pats,pats2)


  Ben Bolker



More information about the R-help mailing list