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 <hadley@posit.co>
This commit is contained in:
hdigital 2023-07-16 14:30:02 +02:00 committed by GitHub
parent c1e1437fd8
commit be5039f33a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 = "???"
)
```