Debian Codegraph @

tests/testthat/test-bbmle.R

raw
1 skip_on_cran()
2
3 skip_if_not_installed("modeltests")
4 library(modeltests)
5
6 skip_if_not_installed("bbmle")
7
8 test_that("tidy.mle2", {
9 check_arguments(tidy.mle2)
10
11 df <- tibble(
12 x = 0:10,
13 y = c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
14 )
15
16 fit <- bbmle::mle2(
17 y ~ dpois(lambda = ymean),
18 start = list(ymean = 10),
19 data = df
20 )
21
22 td <- tidy(fit, conf.int = TRUE)
23
24 check_tidy_output(td)
25 check_dims(td, 1, 7)
26 })