[datatable-help] indexing with NA i

Johann Hibschman jhibschman+r at gmail.com
Wed Jun 22 17:32:33 CEST 2011


The documentation for data.table says that logical vectors "work the
same way they do in '[.data.frame'".  They do not, since NA entries are
treated as FALSE, instead of generating an all-NA row.  Similarly,
expressions returning NA are treated as FALSE.

Personally, I like this behavior much more than the default for
data.frame.  Is it by accident or by intent?  More pragmatically, can I
count on it to remain the same, barring of course a big soul-searching
discussion on the mailing list?

If it's by intent, maybe add a line to the documentation, "with the
exception that NA logical values are treated as FALSE," or some such?

-Johann



More information about the datatable-help mailing list