tests/testthat/test-multiplot.R

context("multiplot")

test_that("single multiplot", {
  expect_silent(multiplot(ggplot2::qplot(seq(10), seq(11, 20))))
  expect_silent(multiplot(
    ggplot2::qplot(seq(10), seq(11, 20)),
    ggplot2::qplot(1:10, 20:11)
  ))
  expect_silent(multiplot(
    ggplot2::qplot(seq(10), seq(11, 20)),
    ggplot2::qplot(1:10, 20:11),
    ncol = 2
    ))
  expect_silent(multiplot(
    plotlist = list(
      ggplot2::qplot(seq(10), seq(11, 20)),
      ggplot2::qplot(seq(10), seq(20, 11))),
    ncol = 2
  ))
  expect_silent(multiplot(
    plotlist = list(
      ggplot2::qplot(seq(10), seq(11, 20)),
      ggplot2::qplot(seq(10), seq(20, 11))),
    ncol = 2,
    layout = as.matrix(c(2,1))
  ))
})
averissimo/loose.rock documentation built on Dec. 8, 2022, 11:53 p.m.