tests/testthat/test-plots.R

test_that("`plots()` works", {
  skip_if_not_installed("patchwork")

  p1 <- ggplot(iris, aes(x = Petal.Length, y = Sepal.Width)) +
    geom_point()
  p2 <- ggplot(iris, aes(x = Petal.Length)) +
    geom_density()

  expect_s3_class(plots(p1, p2), "ggplot")
})

Try the see package in your browser

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

see documentation built on Nov. 3, 2023, 5:10 p.m.