<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;">Michael,</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;">You should be using `CJ`. This is no different from the post from Garrett See <a href="http://lists.r-forge.r-project.org/pipermail/datatable-help/2014-June/002619.html">http://lists.r-forge.r-project.org/pipermail/datatable-help/2014-June/002619.html</a> just last week, IIUC.</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_1403336567927876096" 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">Michael Smith</span> <a href="mailto:my.r.help@gmail.com">my.r.help@gmail.com</a><br>Reply: <span style="color:black">Michael Smith</span> <a href="mailto:my.r.help@gmail.com">my.r.help@gmail.com</a><br>Date: <span style="color:black">June 21, 2014 at 9:40:17 AM</span><br>To: <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"> [datatable-help] Self-Join: Potential Bug? <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>I'm getting a warning when I run the following code in 1.9.2,
<br>dev-1.9.3-master, and dev-1.9.3-issue_700 (b/c I thought it looks
<br>similar to that issue, but it turns out it's different). In contrast, I
<br>do not get this warning in 1.8.10.
<br>
<br>Not sure whether this is a bug or whether I'm missing something:
<br>
<br>X <- data.table(
<br>  structure(list(ID = c(45063L, 45066L, 45172L), date = structure(c(14548,
<br>14487, 14395), class = "Date"), price = c(17.56, 12.49, 10.04
<br>)), .Names = c("ID", "date", "price"), row.names = c(NA, -3L), class =
<br>"data.frame"),
<br>  key = "ID,date")
<br>X[J(unique(ID), as.Date(c("2009-05-31", "2010-05-31")))]
<br>
<br>
<br>The data and the warning message look like this:
<br>
<br>> X
<br>      ID       date price
<br>1: 45063 2009-10-31 17.56
<br>2: 45066 2009-08-31 12.49
<br>3: 45172 2009-05-31 10.04
<br>> X[J(unique(ID), as.Date(c("2009-05-31", "2010-05-31")))]
<br>      ID       date price
<br>1: 45063 2009-05-31    NA
<br>2: 45066 2010-05-31    NA
<br>3: 45172 2009-05-31 10.04
<br>Warning message:
<br>In as.data.table.list(i) :
<br>  Item 2 is of size 2 but maximum size is 3 (recycled leaving a
<br>remainder of 1 items)
<br>
<br>
<br>Thanks,
<br>M
<br>_______________________________________________
<br>datatable-help mailing list
<br>datatable-help@lists.r-forge.r-project.org
<br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
<br></div></div></span></blockquote></body></html>