With the usual data.frameyou can do something like this:
head(mtcars[, 2]) %in% 6
[1] TRUE TRUE FALSE TRUE FALSE TRUE
How can I do the same with data.table? I tried something like this, didn't work:
as.data.table(mtcars)[, 2] %in% 4
[1] FALSE
Of course, there is always a way as.data.frame(myDT), but it does not look elegant.
source
share