inst/tinytest/test_char2factor.R

if (interactive()) {
    pkgload::load_all()
    library("tinytest")
}

expectation <- structure(1:4, levels = c("beech", "oak", "spruce", "fir"), class = "factor")
x <- c("beech", "oak", "spruce", "fir")
result <- char2factor(x)
expect_identical(result, expectation)

Try the fritools package in your browser

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

fritools documentation built on June 8, 2025, 11:59 a.m.