From 233705f0a2b0c453d63dad4319e41715ff5edbbd Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Mon, 13 Nov 2023 15:02:59 +0100 Subject: [PATCH] Tidyselect operations `!` and `-` are subtly different (#1598) * Tidyselect operations `!` and `-` are subtly different * Update data-transform.qmd --------- Co-authored-by: Mine Cetinkaya-Rundel --- data-transform.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-transform.qmd b/data-transform.qmd index cded934..ae5d8b9 100644 --- a/data-transform.qmd +++ b/data-transform.qmd @@ -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: