Re: [R] List-manipulation

From: Richard M. Heiberger <>
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 mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.