tests/testthat/test-beautify.R

test_that("beautify works as expected", {
  # Names are original values, values, are what beautify should them into
  examples <- c(
    "species" = "Species",
    "island" = "Island",
    "bill_length_mm" = "Bill Length (mm)",
    "bill_depth_mm" = "Bill Depth (mm)",
    "flipper_length_mm" = "Flipper Length (mm)",
    "body_mass_g" = "Body Mass (g)",
    "kgtest_kg" = "Kgtest (kg)",
    "sex" = "Sex"
  )

  expect_equal(examples, beautify(names(examples)), ignore_attr = TRUE)
})

Try the gg1d package in your browser

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

gg1d documentation built on April 12, 2025, 1:38 a.m.