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() fails on already grouped data frame when using .data pronoun #3533

Closed
kevinykuo opened this issue Apr 24, 2018 · 2 comments
Closed
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@kevinykuo
Copy link

kevinykuo commented Apr 24, 2018

E.g.

iris %>% 
  group_by(Species) %>%
  group_by(.data$Species)
# Error in mutate_impl(.data, dots) : 
#   Column `Species` can't be modified because it's a grouping variable
@romainfrancois romainfrancois self-assigned this Apr 24, 2018
@romainfrancois
Copy link
Member

Kind of related to #2752

We need some special handling of .data$ in group_by, and/or for mutate to understand that there is nothing to do:

> mutate( group_by(iris, Species), .data$Species )
 Error in mutate_impl(.data, dots) : 
  Column `Species` can't be modified because it's a grouping variable 

@romainfrancois romainfrancois added bug an unexpected problem or unintended behavior data frame labels Apr 24, 2018
@lock
Copy link

lock bot commented Nov 4, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Nov 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants