tests/testthat/test-plt-ts.R

test_that("bcat_plt_ts returns ggplot", {
  p <- bcat_plt_ts(ggplot2::economics, x = date, y = unemploy)
  expect_true(inherits(p, "ggplot"))
})

test_that("bcat_plt_ts works with recession_bars", {
  rec <- data.frame(
    start = as.Date(c("2001-03-01", "2007-12-01")),
    end = as.Date(c("2001-11-01", "2009-06-01"))
  )
  p <- bcat_plt_ts(ggplot2::economics, x = date, y = unemploy, recession_bars = rec)
  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.