tests/test_math.coded.R

library(codelist)
source("helpers.R")


codelist <- data.frame(
    codes = c(10, 11, 12),
    labels = c("a", "b", "c")
  )
x <- code(c(10, 12, NA), codelist)

# log etc should not work
expect_error(log(x))
expect_error(tan(x))
expect_error(abs(x))

Try the codelist package in your browser

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

codelist documentation built on April 12, 2025, 2:25 a.m.