[datatable-help] NA in joins

Juan Manuel Truppia jmtruppia at gmail.com
Thu Sep 18 18:14:19 CEST 2014


Hi, this must have been discussed before, but I couldn't find anything.

In my opinion, NA shouldn't join with anything, including other NA (as to
mirror what we expect from SQL, where NULL doesn't join with NULL).

However, with data.table, NA matches other NA.

I.e, this should return an empty data.table

data.table(idx = NA_real_, key = "idx")[data.table(idx = NA_real_, val =
"a", key = "idx"), nomatch = 0]

Let's assume that we can't change this behavior, would it be possible to
add a parameter to avoid NA matching NA in [.data.table and merge?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20140918/0c3d70da/attachment.html>


More information about the datatable-help mailing list