1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# rename_loc() works with predicate functions
Code
rename_loc(x, where(is.numeric))
Condition
Error in `rename_loc()`:
! All renaming inputs must be named.
# rename_loc() throws helpful errors
Code
# Unnamed vector
rename_loc(letters, c(foo = a))
Condition
Error in `rename_loc()`:
! Can't rename an unnamed vector.
Code
# Duplicate names (FIXME)
rename_loc(mtcars, c(foo = cyl, foo = disp))
Condition
Error in `rename_loc()`:
! Names must be unique.
x These names are duplicated:
* "foo" at locations 1 and 2.
Code
# Unnamed inputs
rename_loc(iris, Species)
Condition
Error in `rename_loc()`:
! All renaming inputs must be named.
|