Re: [R] Transforming list to data frame with corresponding columns

2010-06-07 Thread LCOG1
Henrique, The last message gave me exactly what i needed. Im still not sure whats going on, i will need to reference the do.call function some more. Thanks for your help. Josh Roll Lane Council of Governments Transportation Planner Office: 541-682-2454 Cell: 406-671-5069 jr...@lcog.org www

Re: [R] Transforming list to data frame with corresponding columns

2010-06-07 Thread Henrique Dallazuanna
Try this: `colnames<-`(do.call(rbind, lapply(all2, '[', nm <- unique(unlist(sapply(all2, names), nm) On Mon, Jun 7, 2010 at 4:20 PM, LCOG1 wrote: > > Hi all, > Consider the following. > > > a<-list(c("MHsub","MHsub","SFD","Duplex")) > b<-list(c("MHsub","MHsub","SFD")) > c<-list(c("MHpark"

[R] Transforming list to data frame with corresponding columns

2010-06-07 Thread LCOG1
Hi all, Consider the following. a<-list(c("MHsub","MHsub","SFD","Duplex")) b<-list(c("MHsub","MHsub","SFD")) c<-list(c("MHpark","SFD","SFD")) d<-list(c("MultiFam","MultiFam","MultiFam","Duplex")) all<-list(a,b,c,d) names(all)<-c("5","6","7","8") all2<-list() for(i in 1:length(all)){ all2[[i