<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;">The key part is "row locations in x". If it were to reset for each group, then that part wouldn't have been necessary.</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;">Perhaps it'd be clearer if it were something like this: ".I is an integer vector which, for each group, holds the corresponding row numbers in/from/of x"? Not sure which preposition is most appropriate here. </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_1396353312078300928" 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">Gabor Grothendieck</span> <a href="mailto:ggrothendieck@gmail.com">ggrothendieck@gmail.com</a><br>Reply: <span style="color:black">Gabor Grothendieck</span> <a href="mailto:ggrothendieck@gmail.com">ggrothendieck@gmail.com</a><br>Date: <span style="color:black">April 1, 2014 at 1:45:39 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] .I does not respect by <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>From the documentation I would have expected that the row locations
<br>start over at 1 for each group so that .I = 1:.N. but these are not
<br>equivalent.
<br>
<br>On Tue, Apr 1, 2014 at 7:20 AM, Arunkumar Srinivasan
<br><aragorn168b@gmail.com> wrote:
<br>> Gabor,
<br>>
<br>> It's the same as in 1.8.10 and 1.9.2. What is contradicting in ?data.table?
<br>> It says under .I: ".I is an integer vector length .N holding the row
<br>> locations in x for this group."
<br>>
<br>> The row locations in x for b=1,2,1,2 are 1,2,3,4 which then becomes 1,3 and
<br>> 2,4 for this group => b=1 and b=2 respectively.
<br>>
<br>>
<br>> Arun
<br>>
<br>> From: Gabor Grothendieck ggrothendieck@gmail.com
<br>> Reply: Gabor Grothendieck ggrothendieck@gmail.com
<br>> Date: April 1, 2014 at 1:09:23 PM
<br>> To: datatable-help@lists.r-forge.r-project.org
<br>> datatable-help@lists.r-forge.r-project.org
<br>> Subject: [datatable-help] .I does not respect by
<br>>
<br>> In the following .I seems not to be within group.
<br>>
<br>>> dt <- data.table(a = 1:4, b = 1:2)
<br>>> dt[, .I, by = b]
<br>> b .I
<br>> 1: 1 1
<br>> 2: 1 3
<br>> 3: 2 2
<br>> 4: 2 4
<br>>> packageVersion("data.table")
<br>> [1] '1.9.3'
<br>>
<br>> This seems contrary to ?data.table.
<br>>
<br>>
<br>> --
<br>> Statistics & Software Consulting
<br>> GKX Group, GKX Associates Inc.
<br>> tel: 1-877-GKX-GROUP
<br>> email: ggrothendieck at gmail.com
<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>
<br>
<br>
<br>--
<br>Statistics & Software Consulting
<br>GKX Group, GKX Associates Inc.
<br>tel: 1-877-GKX-GROUP
<br>email: ggrothendieck at gmail.com
<br></div></div></span></blockquote></body></html>