tests/testthat/test_expcatviz.R

context("Distributions of categorical variables")

test_that("test target and color inputs", {
  expect_error(ExpCatViz(data = mtcars, target = "gear", col = rainbow(4)))
  expect_message(ExpCatViz(data = mtcars, target = "mpg"))
})


test_that("test output object", {
  plotlst <- ExpCatViz(mtcars)
  expect_is(plotlst, "list")
  expect_null(names(plotlst))
  expect_true(is.ggplot(plotlst[[1]]))
})

Try the SmartEDA package in your browser

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

SmartEDA documentation built on Dec. 4, 2022, 1:15 a.m.