<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sorry about that! dt.classEx should just be dt.hrEx… Full corrected example below. Also you are correct 3.0.2 is the R version, not 3.2.0. <div>Shir</div><div><br></div><div>-----<br><div><br></div><div><br>library(data.table)<br><br># dates<br>dt.dateEx <- data.table(date = as.character(seq(as.Date('2014-04-01'), as.Date('2014-04-15'), by = 1)))<br>setkey(dt.dateEx, date)<br><br># hours <br>dt.hrEx <- copy(dt.dateEx)<br>dt.hrEx <- dt.hrEx[,  list(hour_beginning =0:23), by = list(dt = date)] # rep x24 per date<br>setkey(dt.hrEx, dt, hour_beginning)<br><br># as expected<br>dt.hrEx[dt.dateEx][, list(dt, hour_beginning)]<br><br># not expected outcome<br>dt.hrEx[dt.dateEx, list(hour_beginning)]<br><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><div>On Mar 25, 2014, at 9:45 AM, Matt Dowle <<a href="mailto:mdowle@mdowle.plus.com">mdowle@mdowle.plus.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      Shir is using v1.9.2 though, although in R 3.2.0 apparently which
      might mean R 3.0.2 perhaps.<br>
      Anyway regardless of versions, the example code results in
      errors.  Shir?<br>
      <br>
      > # dates<br>
      > dt.dateEx <- data.table(date =
      as.character(seq(as.Date('2014-04-01'), as.Date('2014-04-15'), by
      = 1)))<br>
      > setkey(dt.dateEx, date)<br>
      > <br>
      > # hours<br>
      > dt.hrEx <- copy(dt.dateEx)<br>
      > dt.hrEx <- dt.hrEx[,  list(hour_beginning =0:23), by =
      list(dt = date)] # rep x24 per date<br>
      > setkey(dt.hrEx, dt, hour_beginning)<br>
      > <br>
      > # as expected<br>
      > dt.classEx[dt.dateEx][, list(dt, hour_beginning)]<br>
      Error: object 'dt.classEx' not found<br>
      > <br>
      > # not expected outcome<br>
      > dt.classEx[dt.dateEx, list(hour_beginning)]<br>
      Error: object 'dt.classEx' not found<br>
      > <br>
      <br>
      <br>
      <br>
      <br>
      On 24/03/14 19:57, Eduard Antonyan wrote:<br>
    </div>
    <blockquote cite="mid:CAHZcBOrxJ8PCGa3mVLPEcmZ8nhTSr5zApUCnxZ63dTpraNCtDw@mail.gmail.com" type="cite">
      <div dir="ltr">You're probably expecting the by-without-by
        behavior - see this post: <a moz-do-not-send="true" href="http://r.789695.n4.nabble.com/by-EACHI-and-related-please-check-ok-td4686732.html">http://r.789695.n4.nabble.com/by-EACHI-and-related-please-check-ok-td4686732.html</a>
        and follow the links within for more detail.</div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Mar 24, 2014 at 2:37 PM, Shir
          Levkowitz <span dir="ltr"><<a moz-do-not-send="true" href="mailto:levkowitz@dc-energy.com" target="_blank">levkowitz@dc-energy.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">It looks
            like the latest version of data.table has changed the
            behavior of list( ) inside of a join - is this behavior as
            expected? Has anyone reported or encountered this change? It
            seems like a bug to me. I am using data.table v1.9.2 in R
            3.2.0 .<br>
            <br>
            Thanks,<br>
            Shir Levkowitz<br>
            <br>
            <br>
            <br>
            <br>
            <br>
            #-----------------------------------------------<br>
            <br>
            <br>
            library(data.table)<br>
            <br>
            # dates<br>
            dt.dateEx <- data.table(date =
            as.character(seq(as.Date('2014-04-01'),
            as.Date('2014-04-15'), by = 1)))<br>
            setkey(dt.dateEx, date)<br>
            <br>
            # hours<br>
            dt.hrEx <- copy(dt.dateEx)<br>
            dt.hrEx <- dt.hrEx[,  list(hour_beginning =0:23), by =
            list(dt = date)] # rep x24 per date<br>
            setkey(dt.hrEx, dt, hour_beginning)<br>
            <br>
            # as expected<br>
            dt.classEx[dt.dateEx][, list(dt, hour_beginning)]<br>
            <br>
            # not expected outcome<br>
            dt.classEx[dt.dateEx, list(hour_beginning)]<br>
            <br>
            _______________________________________________<br>
            datatable-help mailing list<br>
            <a moz-do-not-send="true" href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>
            <a moz-do-not-send="true" 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><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
datatable-help mailing list
<a class="moz-txt-link-abbreviated" href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></div></div></body></html>