Skip to content

group_by() fails on already grouped data frame when using .data pronoun  #3533

Closed

Description

@kevinykuo

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

Activity

  1. romainfrancois commented on Apr 24, 2018

    @romainfrancois
    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 
    
  2. lock commented on Nov 4, 2018

    @lock

    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/

  3. locked and limited conversation to collaborators on Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions