tests/testthat/test-plt-hist.R

test_that("bcat_plt_hist returns ggplot", {
  p <- bcat_plt_hist(mtcars, x = mpg)
  expect_true(inherits(p, "ggplot"))
})

test_that("bcat_plt_hist works with density overlay", {
  p <- bcat_plt_hist(mtcars, x = mpg, density = TRUE)
  expect_true(inherits(p, "ggplot"))
})

test_that("bcat_plt_hist works with faceting", {
  p <- bcat_plt_hist(mtcars, x = mpg, facet = ggplot2::vars(cyl))
  expect_true(inherits(p, "ggplot"))
})

Try the Rbearcat package in your browser

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

Rbearcat documentation built on March 21, 2026, 5:07 p.m.