Dear R developers, Reviewing my code, I have realized that about 80% of the time in the lapply I need to access the names of the objects inside the loop. In such cases I iterate over indexes or names: lapply(names(x), ... [i]), lapply(seq_along(x), ... x[[i]] ... names(x)[i] ), or for(i in seq_along(x)) ... which is rather inconvenient. How about an argument to lapply which would specify the [ or [[ subseting to use in the splitting of the vector? Or may be a different set of functions lapply1, sapply1? I believe this pattern is rather common for other users as well. Thanks. VS.
lapply version with [ subseting - a suggestion
4 messages · Vitalie S., Michael Lawrence, Henrique Dallazuanna
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100921/1eff12ee/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100921/10af4ffd/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100921/3f6f488d/attachment.pl>