[datatable-help] Indexing by a logical column

G See gsee000 at gmail.com
Tue Apr 23 20:46:12 CEST 2013


Hi,

Is the following expected behavior?

DT = data.table(x=rep(c("a","b","c"),each=3), TF=c(TRUE,FALSE,TRUE))

#All of these return what I expect:

DT[c(TRUE, FALSE, TRUE)]
DT[TF==TRUE]
DT[DT$TF]

#Why doesn't this?
DT[TF]
#Error in eval(expr, envir, enclos) : object 'TF' not found

Thanks,
Garrett


More information about the datatable-help mailing list