res <- lapply(1:length(L),do.one)

Actually, I do

res <- lapply(:length(L),function(x)do.one(L[x]))

-- this is the price of needing the element's name, so I have to both make do.one extract the name and the meat separately inside, and lapply becomes ugly. Yet the obvious alternatives -- extracting the names separately, attaching them back into list elements, etc., -- are even uglier. Something pretty? :)

Cheers,
Alexy

______________________________________________
R-help@r-project.org 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