diff --git a/R/methods_format.R b/R/methods_format.R index ecc1af2d..f7c0dc46 100644 --- a/R/methods_format.R +++ b/R/methods_format.R @@ -40,7 +40,7 @@ format.easycormatrix <- function(x, stars = NULL, include_significance = NULL, format = NULL, - zap_small = TRUE, + zap_small = NULL, bf_exact = TRUE, ...) { # If it's a real matrix diff --git a/tests/testthat/_snaps/windows/correlation.md b/tests/testthat/_snaps/windows/correlation.md new file mode 100644 index 00000000..f902b558 --- /dev/null +++ b/tests/testthat/_snaps/windows/correlation.md @@ -0,0 +1,28 @@ +# correlation output with zap_small + + Code + summary(r) + Output + # Correlation Matrix (pearson-method) + + Parameter | z | y + ----------------------- + x | 0.02 | 0.01 + y | 0.00 | + + p-value adjustment method: Holm (1979) + +--- + + Code + summary(r, zap_small = FALSE) + Output + # Correlation Matrix (pearson-method) + + Parameter | z | y + -------------------------------- + x | 0.02 | 6.02e-03 + y | -3.07e-03 | + + p-value adjustment method: Holm (1979) + diff --git a/tests/testthat/test-correlation.R b/tests/testthat/test-correlation.R index 7478e11c..81b24bcb 100644 --- a/tests/testthat/test-correlation.R +++ b/tests/testthat/test-correlation.R @@ -198,3 +198,16 @@ test_that("as.data.frame for correlation output", { set.seed(123) expect_snapshot(as.data.frame(correlation(ggplot2::msleep))) }) + +test_that("correlation output with zap_small", { + set.seed(123) + d <- data.frame( + x = rnorm(10000), + y = rnorm(10000), + z = rnorm(10000) + ) + r <- correlation::correlation(d) + + expect_snapshot(summary(r), variant = "windows") + expect_snapshot(summary(r, zap_small = FALSE), variant = "windows") +})