| 1 |
skip_on_cran() |
| 2 |
|
| 3 |
skip_if_not_installed("modeltests") |
| 4 |
library(modeltests) |
| 5 |
|
| 6 |
skip_if_not_installed("MASS") |
| 7 |
|
| 8 |
set.seed(27) |
| 9 |
x <- rnorm(100, 5, 2) |
| 10 |
fit <- suppressWarnings(MASS::fitdistr(x, dnorm, list(mean = 3, sd = 1))) |
| 11 |
|
| 12 |
test_that("fitdistr tidier arguments", { |
| 13 |
check_arguments(tidy.fitdistr) |
| 14 |
check_arguments(glance.fitdistr) |
| 15 |
}) |
| 16 |
|
| 17 |
test_that("tidy.fitdistr", { |
| 18 |
td <- tidy(fit) |
| 19 |
check_tidy_output(td) |
| 20 |
check_dims(td, 2, 3) |
| 21 |
}) |
| 22 |
|
| 23 |
test_that("glance.fitdistr", { |
| 24 |
gl <- glance(fit) |
| 25 |
check_glance_outputs(gl) |
| 26 |
check_dims(gl, expected_cols = 4) |
| 27 |
}) |