tests/testthat/test-plot-boxplot.r

context("boxplot")

test_that("test scales", {
  expect_error(plot_scatterplot(iris, by = "Species", scale_x = "log"))
})

test_that("test return object", {
  boxplot_list <- plot_boxplot(iris, by = "Species")
  expect_is(boxplot_list, "list")
  expect_equal(names(boxplot_list), "page_1")
  expect_true(is.ggplot(boxplot_list[[1]]))
  
  boxplot_list2 <- plot_boxplot(iris, by = "Species", nrow = 1L, ncol = 1L)
  expect_is(boxplot_list2, "list")
  expect_equal(names(boxplot_list2), c("page_1", "page_2", "page_3", "page_4"))
  expect_true(all(vapply(boxplot_list2, is.ggplot, TRUE)))
})

Try the DataExplorer package in your browser

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

DataExplorer documentation built on Dec. 16, 2020, 1:07 a.m.