Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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?

# for free to join this conversation on GitHub. Already have an account? # 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