-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
library(dplyr)
#>
#> Attachement du package : 'dplyr'
#> Les objets suivants sont masqués depuis 'package:stats':
#>
#> filter, lag
#> Les objets suivants sont masqués depuis 'package:base':
#>
#> intersect, setdiff, setequal, union
library(reuseme)
mtcars |> group_by(vs) |> summarise(avg_mpg = mean(mpg), error = case_when(avg_mpg > 20 ~ "Youppi"))
#> # A tibble: 2 × 3
#> vs avg_mpg error
#> <dbl> <dbl> <chr>
#> 1 0 16.6 <NA>
#> 2 1 24.6 Youppi
mtcars |> group_by(vs) |> summarise(avg_mpg = mean(mpg), error = case_if_any(avg_mpg > 20 ~ "Youppi"))
#> Error in `summarise()`:
#> ℹ In argument: `error = case_if_any(avg_mpg > 20 ~ "Youppi")`.
#> ℹ In group 1: `vs = 0`.
#> Caused by error:
#> ! objet 'avg_mpg' introuvable
#> Backtrace:
#> ▆
#> 1. ├─dplyr::summarise(...)
#> 2. ├─dplyr:::summarise.grouped_df(...)
#> 3. │ └─dplyr:::summarise_cols(.data, dplyr_quosures(...), by, "summarise")
#> 4. │ ├─base::withCallingHandlers(...)
#> 5. │ └─dplyr:::map(quosures, summarise_eval_one, mask = mask)
#> 6. │ └─base::lapply(.x, .f, ...)
#> 7. │ └─dplyr (local) FUN(X[[i]], ...)
#> 8. │ └─mask$eval_all_summarise(quo)
#> 9. │ └─dplyr (local) eval()
#> 10. ├─reuseme::case_if_any(avg_mpg > 20 ~ "Youppi")
#> 11. │ └─base::eval(parse(text = condition[1])) at reuseme/R/case-if-any.R:35:2
#> 12. │ └─base::eval(parse(text = condition[1]))
#> 13. └─base::.handleSimpleError(...)
#> 14. └─dplyr (local) h(simpleError(msg, call))
#> 15. └─dplyr (local) handler(cnd)
#> 16. └─rlang::abort(message, class = error_class, parent = parent, call = error_call)Created on 2023-07-21 with reprex v2.0.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working