tests/testthat/test_new_order.R

context("reorder vector and factorize")

test_that("new_order() works", {
  
  x <- c("A", "B", "A", "F", "C", "E", "D", "F", "G")
  
  order <- c("F", "E", "D", "C", "B", "A")
  
  expect_identical(levels(new_order(x, order)), order)
  
})
  
  
ktbaek/krisr documentation built on Feb. 21, 2022, 12:07 a.m.