markfairbanks / tidytable

Tidy interface to 'data.table'
https://markfairbanks.github.io/tidytable/
Other
450 stars 32 forks source link

Implement `group_cols()` selection helper #684

Closed markfairbanks closed 2 years ago

markfairbanks commented 2 years ago
library(dplyr, w = FALSE)

df <- tibble(x = c("a", "a", "b"), y = c("a", "a", "b"), z = 1:3)

df %>%
  group_by(x, y) %>%
  select(group_cols())
#> # A tibble: 3 × 2
#> # Groups:   x, y [2]
#>   x     y    
#>   <chr> <chr>
#> 1 a     a    
#> 2 a     a    
#> 3 b     b