We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link
This option would only be useful where j depends on some value from the previous group; as demonstrated here :
http://stackoverflow.com/a/8833899/403310
If you mix up the order of DT there, so it isn't sorted by TreatmentID: set.seed(10) DT2 = DT[sample(1:24)]
then
r=0; DT2[,{r<<-min(Rank[Rank>r]); .SD[Rank==r]}, keyby=TreatmentID]
returns slightly different (but correct) results because Rank 3 and 4 both appear in both IDs 2 and 3.
Changing by to keyby, returns the same result, just ordered differently.
Perhaps keyby should run the groups in the sorted order, instead. Or perhaps that should be optional.
To repeat the begining of this FR, it only makes a difference if each group depends on the previous group result, as in that S.O. answer.
The text was updated successfully, but these errors were encountered:
a398972 implements this.
Sorry, something went wrong.
74b0918
No branches or pull requests
Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link
This option would only be useful where j depends on some value from the previous group; as demonstrated here :
http://stackoverflow.com/a/8833899/403310
If you mix up the order of DT there, so it isn't sorted by TreatmentID:
set.seed(10)
DT2 = DT[sample(1:24)]
then
r=0; DT2[,{r<<-min(Rank[Rank>r]); .SD[Rank==r]}, keyby=TreatmentID]
returns slightly different (but correct) results because Rank 3 and 4 both appear in both IDs 2 and 3.
Changing by to keyby, returns the same result, just ordered differently.
Perhaps keyby should run the groups in the sorted order, instead. Or perhaps that should be optional.
To repeat the begining of this FR, it only makes a difference if each group depends on the previous group result, as in that S.O. answer.
The text was updated successfully, but these errors were encountered: