tests/testthat/test-poisson_limits.R

test_that("`Poisson limits are right", {
  lims <- calculate_limits(data.frame(number.seq= c(15,20,30)), target=1,
                           draw_adjusted=FALSE)
  expect_length(lims,5)
  expect_length(lims[,1],3)
  expect_equal(round(lims$ll95,7), c(0.5596924, 0.6108260, 0.6746958))
  expect_equal(round(lims$ul95,6), c(1.649348, 1.544419, 1.427562))
  expect_equal(round(lims$ll99,7), c(0.3862650, 0.4479107, 0.5289724))
  expect_equal(round(lims$ul99,6), c(2.082907, 1.902094, 1.702771))
  
  expect_s3_class(funnel_grey(), "theme")
})

Try the FunnelPlotR package in your browser

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

FunnelPlotR documentation built on June 7, 2023, 6:04 p.m.