<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      On 14/02/14 15:07, Yike Lu wrote:<br>
    </div>
    <blockquote
cite="mid:CAO=aP+dZmtC5d1c62dTeSfDRSn0Fb_XWstpRA6kA5uTd=eaS5w@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks for the info guys! Wondering if there's any
        way I can help?<br>
      </div>
    </blockquote>
    <br>
    Thanks for your offer.  The function iradix in forder.c needs
    copying and tweaking to become i64radix (8 passes instead of 4), or
    making general so that 4 or 8 can be passed in. Should also check
    first how the bit64 package sorts integer64. Then in bmerge.c add a
    case to the switch for integer64 to cast to long long,  add tests to
    tests.Rraw for grouping and joining, update documentation (.Rd)
    files and add checks to init.c.<br>
    <br>
    Is that something you could do?  If you are rusty on C I don't mind
    guiding you through.<br>
    <br>
    Matt<br>
    <br>
    <blockquote
cite="mid:CAO=aP+dZmtC5d1c62dTeSfDRSn0Fb_XWstpRA6kA5uTd=eaS5w@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Feb 12, 2014 at 11:17 AM, <a
            moz-do-not-send="true" href="mailto:caneff@gmail.com">caneff@gmail.com</a>
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:caneff@gmail.com" target="_blank">caneff@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes this
            isn't a data.table criticism, just a bit64 one in general.
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                <div>
                  On Wed Feb 12 2014 at 11:39:47 AM, Matt Dowle <<a
                    moz-do-not-send="true"
                    href="mailto:mdowle@mdowle.plus.com" target="_blank">mdowle@mdowle.plus.com</a>>
                  wrote:</div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div bgcolor="#FFFFFF" text="#000000">
                    <div><br>
                      Sometimes we take the hard road in data.table, to
                      get to a better place.  Once bit64::integer64 is
                      fully supported, it'll be much easier.   All the
                      recent radix work for double applies almost
                      automatically to integer64 for example,  but that
                      radix work had to be done first.</div>
                  </div>
                  <div bgcolor="#FFFFFF" text="#000000">
                    <div><br>
                      <br>
                      On 12/02/14 16:26, <a moz-do-not-send="true"
                        href="mailto:caneff@gmail.com" target="_blank">caneff@gmail.com</a>
                      wrote:<br>
                    </div>
                  </div>
                  <div bgcolor="#FFFFFF" text="#000000">
                    <blockquote type="cite">FYI (and this is a long
                      outstanding argument) this is why I don't like the
                      bit64 package.  These sorts of errors happen
                      silently.  I understand that data.table can't use
                      the other integer64 package, but at least there it
                      is obvious when things are being coerced. <br>
                      <div><br>
                      </div>
                      <div>In my situations, if I am grouping by a
                        int64, it is usually either an ID so I can just
                        make it a character vector instead, or it is
                        something where I don't mind lost precision so I
                        just make it numeric. </div>
                      <br>
                      <div>On Wed Feb 12 2014 at 11:22:40 AM, Matt Dowle
                        <<a moz-do-not-send="true"
                          href="mailto:mdowle@mdowle.plus.com"
                          target="_blank">mdowle@mdowle.plus.com</a>>
                        wrote:</div>
                      <blockquote style="margin:0 0 0
                        .8ex;border-left:1px #ccc
                        solid;padding-left:1ex"> <br>
                        Hi,<br>
                        <br>
                        You're doing nothing wrong.  Although you can
                        load integer64 using fread<br>
                        and create them directly,  data.table's grouping
                        and keys don't work on<br>
                        them yet.  Sorry,  just not yet implemented.
                        Because integer64 are<br>
                        internally stored as type double  (a good idea
                        by package bit64),<br>
                        data.table sees them internally as double and
                        doesn't catch that the<br>
                        type isn't supported yet (hence no error message
                        such as you get for<br>
                        type 'complex').   The particular integer64
                        numbers in this example are<br>
                        quite small so will use the lower bits.  In
                        double, those are the most<br>
                        precise part of the significand, which would
                        explain why only one group<br>
                        comes out here since data.table groups and joins
                        floating point data<br>
                        within tolerance.<br>
                        <br>
                        Matt<br>
                        <br>
                        On 06/02/14 23:38, Yike Lu wrote:<br>
                        > After a long hiatus, I am back to using
                        data.table. Unfortunately,<br>
                        > I've encountered a problem. Am I doing
                        something wrong here?<br>
                        ><br>
                        > require(data.table)<br>
                        ><br>
                        > dt = data.table(idx = 1:100 %% 3, 1:100)<br>
                        > dt[, list(sum(V2)), by = idx]<br>
                        > # normal<br>
                        ><br>
                        > require(bit64)<br>
                        ><br>
                        > dt2 = data.table(idx = integer64(100) +
                        1:100 %% 3, 1:100)<br>
                        > dt2[, list(sum(V2)), by = idx]<br>
                        > # only has one group:<br>
                        > #   idx   V1<br>
                        > #1:   1 5050<br>
                        ><br>
                        <br>
                        _______________________________________________<br>
                        datatable-help mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:datatable-help@lists.r-forge.r-project.org"
                          target="_blank">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>
                    </blockquote>
                    <br>
                  </div>
                </blockquote>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>