-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix by_group processing for factors. #135
Conversation
Previously, library(modeldata)
library(dplyr)
penguins_grouped2 <- penguins %>% group_by(species, island)
probably:::split_dplyr_groups(penguins_grouped2)
#> [[1]]
#> [[1]]$data
#> # A tibble: 0 × 7
#> # ℹ 7 variables: species <fct>, island <fct>, bill_length_mm <dbl>,
#> # bill_depth_mm <dbl>, flipper_length_mm <int>, body_mass_g <int>, sex <fct>
#>
#> [[1]]$filter
#> species == 1L & island == 1L
#>
#> [[1]]$rows
#> [1] 0
#>
#>
#> [[2]]
#> [[2]]$data
#> # A tibble: 0 × 7
#> # ℹ 7 variables: species <fct>, island <fct>, bill_length_mm <dbl>,
#> # bill_depth_mm <dbl>, flipper_length_mm <int>, body_mass_g <int>, sex <fct>
#>
#> [[2]]$filter
#> species == 1L & island == 2L
#>
#> [[2]]$rows
#> [1] 0
#>
#>
#> [[3]]
#> [[3]]$data
#> # A tibble: 0 × 7
#> # ℹ 7 variables: species <fct>, island <fct>, bill_length_mm <dbl>,
#> # bill_depth_mm <dbl>, flipper_length_mm <int>, body_mass_g <int>, sex <fct>
#>
#> [[3]]$filter
#> species == 1L & island == 3L
#>
#> [[3]]$rows
#> [1] 0
#>
#>
#> [[4]]
#> [[4]]$data
#> # A tibble: 0 × 7
#> # ℹ 7 variables: species <fct>, island <fct>, bill_length_mm <dbl>,
#> # bill_depth_mm <dbl>, flipper_length_mm <int>, body_mass_g <int>, sex <fct>
#>
#> [[4]]$filter
#> species == 2L & island == 2L
#>
#> [[4]]$rows
#> [1] 0
#>
#>
#> [[5]]
#> [[5]]$data
#> # A tibble: 0 × 7
#> # ℹ 7 variables: species <fct>, island <fct>, bill_length_mm <dbl>,
#> # bill_depth_mm <dbl>, flipper_length_mm <int>, body_mass_g <int>, sex <fct>
#>
#> [[5]]$filter
#> species == 3L & island == 1L
#>
#> [[5]]$rows
#> [1] 0 Created on 2024-02-22 with reprex v2.1.0 With this PR, it cannot: library(modeldata)
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
penguins_grouped2 <- penguins %>% group_by(species, island)
probably:::split_dplyr_groups(penguins_grouped2)
#> Error in `rlang::sym()`:
#> ! Can't convert a character vector to a symbol. Created on 2024-02-22 with reprex v2.1.0 It doesn't like any tests fail as a result of this, but the comments on the function and the |
Thanks. We'll need to put some better error checking in. It is designed to support a single grouping variable. The docs for
|
Co-authored-by: Simon P. Couch <[email protected]>
This commit removes the unused helper function create_filter_expr from probably/R/cal-estimate-utils.R. The function became obsolete after a partial revert in tidymodels#135. Fixes tidymodels#139
Closes #127
purrr::transpose()
was converting factors to integers.