Hello,
I want to construct a new column in a data.table, based on a simple
ifelse() statement from one of the old columns. Is there a 'proper'
way to do this, or will the simple ifelse() statement make use of
data.table's features, such as indexing?
example:
library(data.table)
DT = data.table(x=rep(c("a","b","c"),each=3),y=c(1,3,6), v=1:9)
DT$u <- ifelse(DT$y>3,1,0)
DT
Thank you,
Zach
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help