tests/testthat/test-shuffle.R

test_that("reproducibility shuffles", {
  set.seed(1014)

  f1 <- factor(c("a", "b"))
  f2 <- fct_shuffle(f1)

  expect_equal(levels(f2), c("a", "b"))
})

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.