Skip to content

Commit

Permalink
Use ! instead of - to negate the selection in docs (tidyverse#5395)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Jul 13, 2020
1 parent f53e9ce commit c6a7ecd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/doc-params.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ NULL
#' * If you have a character vector of column names, use `all_of()`
#' or `any_of()`, depending on whether or not you want unknown variable
#' names to cause an error, e.g `select(df, all_of(vars))`,
#' `select(df, -any_of(vars))`.
#' `select(df, !any_of(vars))`.
#'
#' * If you you want the user to supply a tidyselect specification in a
#' function argument, embrace the function argument, e.g
Expand Down
2 changes: 1 addition & 1 deletion R/mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
#' # to multiple columns in a tibble.
#' starwars %>%
#' select(name, homeworld, species) %>%
#' mutate(across(-name, as.factor))
#' mutate(across(!name, as.factor))
#' # see more in ?across
#'
#' # Window functions are useful for grouped mutates:
Expand Down
2 changes: 1 addition & 1 deletion man/dplyr_tidy_select.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mutate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/dplyr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ starwars %>% select(hair_color, skin_color, eye_color)
# Select all columns between hair_color and eye_color (inclusive)
starwars %>% select(hair_color:eye_color)
# Select all columns except those from hair_color to eye_color (inclusive)
starwars %>% select(-(hair_color:eye_color))
starwars %>% select(!(hair_color:eye_color))
# Select all columns ending with color
starwars %>% select(ends_with("color"))
```
Expand Down

0 comments on commit c6a7ecd

Please sign in to comment.