aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-04-16 18:02:18 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-04-16 18:02:18 +0200
commitd81550d0cccae824cc748de48e7fd50ea8d8033a (patch)
treecb95252ff725b5dcd0237bb8f74fdac4a3e08d15 /tests
parent4bc95b3e4aae22e4052e0a4c905a9227c909e2cd (diff)
Make na.rm = FALSE the default for geomean()
This makes more sense and is in line with mean() from base R. Adapt tests and update docs.
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/test_geomean.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/testthat/test_geomean.R b/tests/testthat/test_geomean.R
index 0cc3416..bf298c2 100644
--- a/tests/testthat/test_geomean.R
+++ b/tests/testthat/test_geomean.R
@@ -4,8 +4,8 @@ context("Geometric mean calculation")
test_that("The geometric mean is correctly calculated", {
expect_equal(geomean(c(1, 3, 9)), 3)
expect_equal(geomean(c(0, 3, 9)), 0)
- expect_error(geomean(c(1, 3, NA, 9), na.rm = FALSE), "NA")
+ expect_equal(geomean(c(1, 3, NA, 9), na.rm = FALSE), NA)
expect_equal(geomean(c(1, 3, NA, 9), na.rm = TRUE), 3)
expect_error(geomean(c(1, -3, 9)), "positive")
- expect_error(geomean(c(1, -3, NA, 9)), "positive")
+ expect_equal(geomean(c(1, -3, NA, 9)), NA)
})

Contact - Imprint