tests/testthat/_snaps/eval-rename.md

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.


Try the tidyselect package in your browser

Any scripts or data that you put into this service are public.

tidyselect documentation built on May 29, 2024, 6:07 a.m.