Skip to content

Commit

Permalink
Ignore some tests for R version < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
gdemin committed Nov 15, 2020
1 parent 849bc4b commit 7cec7fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/testthat/test_subtotal.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 4 additions & 2 deletions tests/testthat/test_weighted_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7cec7fd

Please sign in to comment.