[R] List extraction

Pete Brecknock Peter.Brecknock at bp.com
Tue Mar 29 04:34:58 CEST 2011


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(rownames(x),1,1)

HTH

Pete

--
View this message in context: http://r.789695.n4.nabble.com/List-extraction-tp3413374p3413564.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list