From be5039f33a890b377ded905fab548394d1f76d5d Mon Sep 17 00:00:00 2001 From: hdigital Date: Sun, 16 Jul 2023 14:30:02 +0200 Subject: [PATCH] Use dplyr 1.1 'default' parameter in 'case_when()' (#1525) * Use dplyr 1.1 'default' parameter in 'case_when()' * Update logicals.qmd --------- Co-authored-by: Hadley Wickham --- logicals.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logicals.qmd b/logicals.qmd index 017233a..18af1a7 100644 --- a/logicals.qmd +++ b/logicals.qmd @@ -494,13 +494,13 @@ case_when( ) ``` -If you want to create a "default"/catch all value, use `TRUE` on the left hand side: +Use `.default` if you want to create a "default"/catch all value: ```{r} case_when( x < 0 ~ "-ve", x > 0 ~ "+ve", - TRUE ~ "???" + .default = "???" ) ```