I feel this behavior a bit inconsistent, as select() and rename() shares the same semantics to some extent.
vars_select(names(mtcars), new = 1)
#> new
#> "mpg"
vars_rename(names(mtcars), new = 1)
#> Error: `new` = 1 must be a symbol or a string, not a double vector
For example, they both accept characters. Are there any reason to prevent rename from accepting numbers? (This is not a big problem for me, though. This issue is mostly for my curiosity).
vars_rename(names(mtcars), new = "cyl")
#> mpg new disp hp drat wt qsec vs am gear carb
#> "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear" "carb"
vars_select(names(mtcars), new = "cyl")
#> new
#> "cyl"
I feel this behavior a bit inconsistent, as
select()andrename()shares the same semantics to some extent.For example, they both accept characters. Are there any reason to prevent rename from accepting numbers? (This is not a big problem for me, though. This issue is mostly for my curiosity).