Skip to content
New issue

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

group_by(.) %.% arrange() #369

Closed
romainfrancois opened this issue Apr 4, 2014 · 1 comment
Closed

group_by(.) %.% arrange() #369

romainfrancois opened this issue Apr 4, 2014 · 1 comment
Assignees
Labels

Comments

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Apr 4, 2014

Wondering if it could be interesting to let this syntax:

mtcars %.% group_by(cyl, disp) %.% arrange()

do this implicitly:

mtcars %.% group_by(cyl, disp) %.% arrange(cyl, disp)

So an empty arrange() of a grouped data set would arrange it according to its grouping variables.

This would be very cheap because the information is already in there, we would only have to sort the labels and reorganize the variables, we would not need to sort again. Furthermore we could keep the information that in the resulting data, groups are adjacent.

@hadley
Copy link
Member

@hadley hadley commented Apr 4, 2014

Yes! Let's do this.

On Friday, April 4, 2014, Romain François notifications@github.com wrote:

Wondering if it could be interesting to let this syntax:

mtcars %.% group_by(cyl, disp) %.% arrange()

do this implicitly:

mtcars %.% group_by(cyl, disp) %.% arrange(cyl, disp)

So an empty arrange() of a grouped data set would arrange it according to
its grouping variables.

This would be very cheap because the information is already in there, we
would only have to sort the labels and reorganize the variables, we would
not need to sort again. Furthermore we could keep the information that in
the resulting data, groups are adjacent.


Reply to this email directly or view it on GitHubhttps://github.com//issues/369
.

http://had.co.nz/

@romainfrancois romainfrancois self-assigned this Apr 4, 2014
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants