-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(.drop =) #4091
group_by(.drop =) #4091
Conversation
closes #4061 |
5f01917
to
55c1c18
Compare
55c1c18
to
9c02d20
Compare
I've tried to follow it is stored as an attribute of the grouping structure library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
tibble(
x = 1:2,
f = factor(c("a", "b"), levels = c("a", "b", "c"))
) %>%
group_by(f, .drop = TRUE) %>%
group_data() %>%
str()
#> Classes 'tbl_df', 'tbl' and 'data.frame': 2 obs. of 2 variables:
#> $ f : Factor w/ 3 levels "a","b","c": 1 2
#> $ .rows:List of 2
#> ..$ : int 1
#> ..$ : int 2
#> - attr(*, ".drop")= logi TRUE The unexported |
Depending on tidyverse/dplyr#4091 to be merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall structure looks good, but someone else needs to do a careful reading of the code. @lionel-?
R/colwise-group-by.R
Outdated
@@ -6,7 +6,8 @@ | |||
#' | |||
#' @family grouping functions | |||
#' @inheritParams scoped | |||
#' @param .add Passed to the `add` argument of [group_by()]. | |||
#' @param .add,.drop see [group_by()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just @inheritParams
these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 it's add
on group_by()
and .add
on group_by_*()
I can :
- document
.add
here (probably, but that's kind of bad) - switch to
.add
ingroup_by()
(probably not) - switch to
add
ingroup_by_*()
(I guess not either)
I'll take a look tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. I'll try running this PR against the tests as defined in v0.7.8, hope there are now few failing tests if any.
Co-Authored-By: romainfrancois <[email protected]>
…into group_by_dot_drop
2992c5a
to
0d4179e
Compare
Should group_by <- function(.data, ..., add = FALSE, .add = add, .drop = FALSE) {
...
} |
@romainfrancois we should tackle that in a separate PR, and it can wait until 0.9.0. |
* add helper methods to work around dev dplyr bug tidyverse/dplyr#4096 * use dplyr PR that fixes group_by bug Depending on tidyverse/dplyr#4091 to be merged * use new `.drop = TRUE` argument for `group_by` and remove all `convert_*` methods. * use ungroup and group(run = droplevels(run)) or similar where appropriate works with dplyr 0.7.8 and 0.8.0 * use cran dplyr >= v0.8.0.1 and not the remote * remove dplyr.R file * white space * undo unnecessary changes * remove notion of from plotting.R * clean up run = run in group_by
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/ |
This is not ready yet, I've only so far just added thedrop
argument, it currently does nothing useful.