On Thu, Aug 9, 2012 at 5:30 PM, arun <smartpink...@yahoo.com> wrote:
>
>  lapply(1:length(a$c),function(x) a$b[x]-a$c[[x]])

Arun,

I've seen you use this idiom a few times lately and I'd just like to note that

seq_along()

is an (underutilized) primitive and a safer and faster alternative
(avoiding the pathological length(x) = 0 case).

Cheers,
Michael

______________________________________________
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