diff --git a/tests/testthat/test_subtotal.R b/tests/testthat/test_subtotal.R index 8273304..e2b9c9b 100644 --- a/tests/testthat/test_subtotal.R +++ b/tests/testthat/test_subtotal.R @@ -428,5 +428,6 @@ res = structure(list(row_labels = c("Group 1|varA", "Group 1|varB", 20L, 20L), Mean = c(3.75, 7.75, 2.45, 7.5), SD = c(0.5, 0.957427107756338, 1.14593101656986, 1.05131496607569), Median = c(4, 7.5, 2, 7.5 )), row.names = c(NA, -4L), class = c("etable", "data.frame")) - -expect_equal(output, res) +if(as.numeric(version$major) >=4){ + expect_equal(output, res) +} diff --git a/tests/testthat/test_weighted_stats.R b/tests/testthat/test_weighted_stats.R index 3bd57a5..3c4da0d 100644 --- a/tests/testthat/test_weighted_stats.R +++ b/tests/testthat/test_weighted_stats.R @@ -152,8 +152,10 @@ data(iris) expect_equal(w_mean(x, w), 1.679588893639) expect_equal(w_sum(x, w), 13.633172662) expect_equal(w_median(x, w), 1.78831) -expect_equal(w_median(iris$Petal.Length), 4.4) -expect_equal(w_median(iris$Petal.Length, weight = rep(1, 150)), 4.4) +if(as.numeric(version$major) >=4){ + expect_equal(w_median(iris$Petal.Length), 4.4) + expect_equal(w_median(iris$Petal.Length, weight = rep(1, 150)), 4.4) +} # expect_equal(w_mad(x, w), ???)) expect_equal(w_sd(x, w), 0.2728535109892) expect_equal(w_var(x, w), 0.07444903845913)