Hello,

I wonder if there is a way in data.table (or more generaly in R) to work on
previous row without loops
E.G. something equivalent to :

dt <-data.table(col1=c(1,2,3))
for (i in 2:nrow(dt))
{
dt[i,col3:=dt[i-1,list(col1)]>2]
}

Thanks a lot !
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to