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

Fix .by argument of summarise() to work #2222

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

UchidaMizuki
Copy link
Contributor

Fix #2207.

Probably not the best way, but I update summarise.sf() to allow for .by arguments.
The solution here is to store the row IDs of the original data in the .rows column by dplyr::summarise().

The disadvantage of this solution is that a column named .rows will be overwritten if the user has used it.
However, the column name .rows is not generally used,
since it cannot be used in tibble::tibble() and as a grouping variable for dplyr::group_by() .

I also noticed that summarise.sf() has an argument of .dots, probably past dplyr.
Now I have left it as is, but should I change the documentation as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected summarise() interaction with sf objects
1 participant