Tidyselect operations `!` and `-` are subtly different (#1598)

* Tidyselect operations `!` and `-` are subtly different

* Update data-transform.qmd

---------

Co-authored-by: Mine Cetinkaya-Rundel <cetinkaya.mine@gmail.com>
This commit is contained in:
Lionel Henry 2023-11-13 15:02:59 +01:00 committed by GitHub
parent 10558e4d57
commit 233705f0a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -347,7 +347,7 @@ In this situation, the first challenge is often just focusing on the variables y
select(!year:day)
```
You can also use `-` instead of `!` (and you're likely to see that in the wild); we recommend `!` because it reads as "not", and combines well with `&` and `|`.
Historically this operation was done with `-` instead of `!`, so you're likely to see that in the wild. These two operators serve the same purpose but with subtle differences in behavior. We recommend using `!` because it reads as "not" and combines well with `&` and `|`.
- Select all columns that are characters: