In the documentation for select_all() (and related commands), the .funs argument is described as follows:
.funs | A function fun, a purrr style lambda ~ fun(.) or a list of either form.
If the value passed to .funs is a 0-ary function that returns a character vector of the right length, this vector is used to rename columns according to (relative) column index:
library(tidyverse)
mpg %>%
rename_at(2:3, ~letters[1:2])
#> # A tibble: 234 x 11#> manufacturer a b year cyl trans drv cty hwy fl class#> <chr> <chr> <dbl> <int> <int> <chr> <chr> <int> <int> <chr> <chr>#> 1 audi a4 1.8 1999 4 auto(l… f 18 29 p comp…
In other words, in this case the value passed to .funs is not treated as a function, which instead would assign the entire character vector as the name of every column. A mention of this special case in the documentation would be helpful.
The text was updated successfully, but these errors were encountered:
In the documentation for
select_all()
(and related commands), the.funs
argument is described as follows:If the value passed to
.funs
is a 0-ary function that returns a character vector of the right length, this vector is used to rename columns according to (relative) column index:In other words, in this case the value passed to
.funs
is not treated as a function, which instead would assign the entire character vector as the name of every column. A mention of this special case in the documentation would be helpful.The text was updated successfully, but these errors were encountered: