tests/testthat/test-unlabel.R

context("unlabel()")

test_that(
  "unlabel.default()"
  , {
    x <- letters
    variable_label(x) <- "Label to be removed"

    expect_identical(
      unlabel(x)
      , letters
    )
  }
)

test_that(
  "unlabel.data.frame()"
  , {
    x <- npk
    variable_label(x) <- list(N = "Nitrogen", yield = "Yield", P = expression(italic(P)))

    expect_identical(
      unlabel(x)
      , npk
    )
  }
)

Try the tinylabels package in your browser

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

tinylabels documentation built on April 4, 2025, 2:02 a.m.