tests/testthat/_snaps/lvls.md

must include all existing levels

Code
  lvls_expand(f1, c("a", "c"))
Condition
  Error in `lvls_expand()`:
  ! `new_levels` must include all levels in `f`.
  i Missing 1 level: b

new_levels must checks its inputs

Code
  lvls_revalue(f1, 1:5)
Condition
  Error in `lvls_revalue()`:
  ! `new_levels` must be a character vector, not an integer vector.
Code
  lvls_revalue(f1, c("a", "b", "c"))
Condition
  Error in `lvls_revalue()`:
  ! `new_levels` must be the same length (3) as `levels(f)` (2).


Try the forcats package in your browser

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

forcats documentation built on Feb. 16, 2023, 8:57 p.m.