tests/testthat/test-label-compose.R

test_that("compose_labels can chain together functions", {
  labeller <- compose_label(`-`, label_number(suffix = " foo"), toupper)
  expect_equal(
    labeller(c(0.1, 1.0, 10.0)),
    c("-0.1 FOO", "-1.0 FOO", "-10.0 FOO"),
    ignore_attr = TRUE
  )
})

Try the scales package in your browser

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

scales documentation built on June 8, 2025, 12:13 p.m.