<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Thanks. It'd also be great if you could add an issue for adding the documentation.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">On NA non-matching, yes you could add an FR, there isn't one to my recollection. However much of this year has been spent on internal order and binary search in tweaking quite a lot of things. So I'd not be surprised if it is not attended to anytime soon.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div> <div id="bloop_sign_1411068683375664896" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">Arun</div></div> <div style="color:black"><br>From: <span style="color:black">Juan Manuel Truppia</span> <a href="mailto:jmtruppia@gmail.com"><jmtruppia@gmail.com></a><br>Reply: <span style="color:black">Juan Manuel Truppia</span> <a href="mailto:jmtruppia@gmail.com"><jmtruppia@gmail.com>></a><br>Date: <span style="color:black">September 18, 2014 at 9:14:42 PM</span><br>To: <span style="color:black">Arunkumar Srinivasan</span> <a href="mailto:aragorn168b@gmail.com"><aragorn168b@gmail.com>></a><br>Cc: <span style="color:black">datatable-help@lists.r-forge.r-project.org</span> <a href="mailto:datatable-help@lists.r-forge.r-project.org"><datatable-help@lists.r-forge.r-project.org>></a><br>Subject: <span style="color:black"> Re: [datatable-help] NA in joins <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">It might help, specially where data.table is
compared to SQL. However, I think that having merge (and maybe
[.data.table) have an argument to avoid NA matching. Is there a FR
already created for this? I can create it otherwise</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Sep 18, 2014 at 4:00 PM, Arunkumar
Srinivasan <span dir="ltr"><<a href="mailto:aragorn168b@gmail.com" target="_blank">aragorn168b@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
In base R `NA` matches `NA` alone, and `NaN` matches `NaN`
alone:</div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
match(NA, c(1:5, NA))</div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
# [1] 6</div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<br></div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<span style="font-family:sans-serif">data.table</span><span style="font-family:sans-serif"> matches, through binary search, by
design, in the same way. </span>And in `?match`, there's this
line: "<span style="font-family:sans-serif">Exactly what matches
what is to some extent a matter of definition." In some operations
it may not make sense. But, by design, we do consider Inf = Inf,
-Inf = -Inf, NaN = NaN and NA = NA always. Do you think it'd help
tp state this explicitly in `?data.table`?</span></div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<span style="font-family:sans-serif"><br></span></div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<span style="font-family:sans-serif"><br></span></div>
<div>
<div style="font-family:helvetica,arial;font-size:13px">Arun</div>
</div>
<div style="color:black"><br>
From: <span style="color:black">Juan Manuel Truppia</span>
<a href="mailto:jmtruppia@gmail.com" target="_blank"><jmtruppia@gmail.com></a><br>
Reply: <span style="color:black">Juan Manuel Truppia</span>
<a href="mailto:jmtruppia@gmail.com" target="_blank"><jmtruppia@gmail.com>></a><br>
Date: <span style="color:black">September 18, 2014 at 6:14:56
PM</span><br>
To: <span style="color:black"><a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a></span>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank"><datatable-help@lists.r-forge.r-project.org>></a><br>

Subject:  <span style="color:black">[datatable-help] NA in
joins<br></span></div>
<br>
<blockquote type="cite">
<div>
<div>
<div>
<div class="h5">
<div dir="ltr"><span>Hi, this must have been discussed before, but
I couldn't find anything.</span>
<div><span><br></span></div>
<div><span>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).</span></div>
<div><span><br></span></div>
<div><span>However, with data.table, NA matches other
NA.</span></div>
<div><span><br></span></div>
<div><span>I.e, this should return an empty data.table</span></div>
<div><span><br></span></div>
<div><span>data.table(idx = NA_real_, key = "idx")[data.table(idx =
NA_real_, val = "a", key = "idx"), nomatch = 0]<br></span></div>
<div><span><br></span></div>
<div><span>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?</span></div>
</div>
</div>
</div>
<span>_______________________________________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></span></div>
</div>
</blockquote>
</div>
</blockquote>
</div>
<br></div>


</div></div></span></blockquote></body></html>