diff --git a/DESCRIPTION b/DESCRIPTION index df352bf0a..788933a01 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,6 +43,7 @@ Suggests: brms, curl, data.table, + discovr, dplyr (>= 1.1), effectsize, emmeans, diff --git a/tests/testthat/_snaps/discovr.md b/tests/testthat/_snaps/discovr.md new file mode 100644 index 000000000..00a2e1d49 --- /dev/null +++ b/tests/testthat/_snaps/discovr.md @@ -0,0 +1,12 @@ +# discovr-book-examples, chap 8.8 + + Code + print(out, table_width = Inf) + Output + Variable | Mean | 95% CI (Mean) | SD | IQR | Skewness | Kurtosis | n | n_Missing + ---------------------------------------------------------------------------------------------- + adverts | 614.41 | [557.21, 686.82] | 485.66 | 696.21 | 0.85 | 0.24 | 200 | 0 + sales | 193.20 | [182.70, 203.48] | 80.70 | 117.50 | 0.04 | -0.68 | 200 | 0 + airplay | 27.50 | [25.92, 29.25] | 12.27 | 16.75 | 0.06 | -0.03 | 200 | 0 + image | 6.77 | [6.58, 6.98] | 1.40 | 2.00 | -1.29 | 3.74 | 200 | 0 + diff --git a/tests/testthat/test-discovr.R b/tests/testthat/test-discovr.R new file mode 100644 index 000000000..8db97904b --- /dev/null +++ b/tests/testthat/test-discovr.R @@ -0,0 +1,13 @@ +skip_if_not_installed("discovr") + +test_that("discovr-book-examples, chap 8.8", { + data(album_sales, package = "discovr") + set.seed(123) + out <- describe_distribution( + album_sales, + range = FALSE, + ci = 0.95, + iterations = 500 + ) + expect_snapshot(print(out, table_width = Inf)) +})