tests/testthat/test-stat_n_text.R

test_that("stat_n_text works as expected", {
  p <- ggplot(mtcars, aes(x = factor(cyl), y = mpg, color = factor(cyl))) +
    geom_point() +
    labs(x = "Number of Cylinders", y = "Miles per Gallon")
  result <- expect_silent(
    p + stat_n_text()
  )
  expect_s3_class(result, "ggplot")
})

Try the ggplot2.utils package in your browser

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

ggplot2.utils documentation built on June 26, 2024, 1:06 a.m.