Rdatatable / data.table

R's data.table package extends data.frame:
http://r-datatable.com
Mozilla Public License 2.0
3.62k stars 985 forks source link

[R-Forge #797] Set bysameorder when by uses remainder of key not used by the i group lookup #674

Open arunsrinivasan opened 10 years ago

arunsrinivasan commented 10 years ago

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

setkey(DT,colA,colB)

won't need mult="all" :

DT["value23",sum(v1),by="colB"]

but the subset is known to be already ordered. The by is the remainder of the key not used by the i.

Also, if we had a distinction between keys and unique keys, the mult argument could be set accordingly rather than the default="first" for single column keys which may well contain duplicates.

jangorecki commented 4 years ago

will it apply as well if the order of first key column be affected?

DT[c("value23","value01"),sum(v1),by="colB"]

what exactly means Set bysameorder?