Thanks everybody, Seth's solution is not the general one I was looking for. Both of the others are. Thanks!
Joh Liaw, Andy wrote: > From: Marc Schwartz >> >> On Thu, 2007-04-12 at 18:12 +0200, Johannes Graumann wrote: >> > Dear Rologists, >> > >> > I'm stuck with this. How would you do this efficiently: >> > >> > > aPGI >> > [[1]] >> > [1] "864" "5576" >> > >> > >> > > aPGItest >> > [[1]] >> > [1] TRUE FALSE >> > >> > > result <- [magic box involving subset) >> > >> > > result >> > [[1]] >> > [1] "864" >> > >> > Thanks for any hints, >> > >> > Joh >> >> >> > lapply(seq(along = length(aPGI)), function(x) >> > aPGI[[x]][aPGItest[[x]]]) >> [[1]] >> [1] "864" > > Alternatively: > > R> mapply("[", aPGI, aPGItest, SIMPLIFY=FALSE) > [[1]] > [1] "864" > > Cheers, > Andy > > >> >> I think that this should be a generic solution for multiple >> (but common) levels in each list. >> >> HTH, >> >> Marc Schwartz >> >> ______________________________________________ >> [EMAIL PROTECTED] 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. >> >> >> > > > ------------------------------------------------------------------------------ > Notice: This e-mail message, together with any attachments,...{{dropped}} > > ______________________________________________ > [EMAIL PROTECTED] 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. ______________________________________________ [EMAIL PROTECTED] 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.