title: Rank values in r datatable grouped by another variable
body: <p>I would like to use datatable's frank function to rank the date column by id.  However, my rankings only seem to take into consideration the date column and not the id corresponding to it. I also receive 6 of these warnings that I'm not sure about:</p>
  
  <p>1.....
      6: In <code>[.data.table</code>(dups, , <code>:=</code>(rank, frank(dups, date, ties.method = "average")),  :
        RHS 1 is length 10 (greater than the size (1) of group 6). The last 9 element(s) will be discarded.</p>
  
  <pre><code>dups &lt;- data.table (id = c('11', '11', '11', '22','22',
    '88', '99','44','44', '55'),
    date = mdy(c("1-01-2016", "1-02-2016", "1-02-2016","2-01-2016", 
    "2-02-2016")))
  
  so.sample &lt;- dups[, rank := frank(dups, date, ties.method = "average"), by = id]
  </code></pre>
  
  <p>For example, id = 11 and date = 2016-01-01 should rank 1 instead of 1.5, because there is only one id and date with that combination.</p>
  
  <p>thx for help</p>