indexing in data frames
On Thu, Aug 9, 2012 at 5:30 PM, arun <smartpink111 at 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