tests/testthat/test_as.is1.R

context("Looking at the levels")

test_that("as.is converts character vector to factor with levels as what we see ",{
  x <- c("a","b","g","g","f","c","c","c")
  y <- as.is(x)
  expect_identical(levels(y),unique(x))
})
BattaLiu/HW8JiayiLiu documentation built on May 5, 2019, 10:31 a.m.