tests/testthat/test-label-glue.R

test_that("label_glue environments work out as intended", {
  x <- LETTERS[1:3]
  y <- "foo"

  # Note `{x}` should mask the `x <- LETTERS[1:3]` above
  f <- label_glue("{x} and {y}")
  expect_equal(f(letters[1:3]), c("a and foo", "b and foo", "c and foo"))
})

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.