We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
case_if_any()
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
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Created on 2023-07-21 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: