Re: [R] List extraction

2011-03-29 Thread Dennis Murphy
> do.call(rbind, L) ID stat pvalue a.1 Herb4 0.03 a.2 Shrub5 0.04 b.1 Herb 12 0.20 b.2 Shrub 15 0.40 b.3 Tree 13 0.30 HTH, Dennis On Mon, Mar 28, 2011 at 5:01 PM, chipmaney wrote: > I have created a list of tables with the same columns but different number >

[R] List extraction

2011-03-29 Thread chipmaney
I have created a list of tables with the same columns but different number of row. Example (actual list has ~200 elements): > temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) > temp2<- data.frame(ID=c("Herb","Shrub", > "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) > L<-list

Re: [R] List extraction

2011-03-28 Thread Pete Brecknock
Doesn't use apply but maybe the following will work for you? temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) temp2<- data.frame(ID=c("Herb","Shrub", "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) L<-list(a=temp1,b=temp2) d.f = do.call("rbind",L) d.f$tableName = substring(ro