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.

Reply via email to