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 should use .drop = TRUE by default? #4208

yutannihilation opened this issue Feb 21, 2019 · 3 comments · Fixed by #4209
Closed should use .drop = TRUE by default? #4208

yutannihilation opened this issue Feb 21, 2019 · 3 comments · Fixed by #4209


Copy link

Related: tidyverse/tidyr#555 (comment)

I think this .drop, which is passed to group_by(), should be TRUE or group_drops(.data) (which should return TRUE for data.frame) by default. <- function(.data, ..., .drop = FALSE) {

tidyverse/tidyr#555 (comment) might be a tidyr's fault in that it should not expect the group indices are always consecutive integers. But, I feel the behaviour below is inconsistent and should be fixed.

library(dplyr, warn.conflicts = FALSE)

d <- tibble(x = letters[1:10], y = rep(1:2, each = 5), z = factor(rep(LETTERS[1:2], each = 5)))

d %>% 
  group_by(y, z) %>%
#>  [1] 1 1 1 1 1 2 2 2 2 2

d %>% 
  group_indices(y, z)
#>  [1] 1 1 1 1 1 4 4 4 4 4

Created on 2019-02-21 by the reprex package (v0.2.1.9000)

Copy link

indeed, can you send a pull request please ?

Copy link
Member Author


Copy link

lock bot commented Aug 20, 2019

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.

@lock lock bot locked and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging a pull request may close this issue.

2 participants