Re: [R] List-manipulation

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Sat 30 Sep 2006 - 03:00:38 EST


You need one of the apply family of functions. ?sapply

> tmp <- list(a=1:2, b=3:5, c=5, dd=numeric(0), e=1:8)
> sapply(tmp, function(x) x[1])
 a b c dd e
 1 3 5 NA 1



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Sep 30 03:22:10 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 30 Sep 2006 - 06:06:49 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.