aboutsummaryrefslogtreecommitdiff
path: root/man/geomean.Rd
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 /man/geomean.Rd
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 'man/geomean.Rd')
-rw-r--r--man/geomean.Rd7
1 files changed, 4 insertions, 3 deletions
diff --git a/man/geomean.Rd b/man/geomean.Rd
index 2887929..506e64d 100644
--- a/man/geomean.Rd
+++ b/man/geomean.Rd
@@ -4,7 +4,7 @@
\alias{geomean}
\title{Calculate the geometric mean}
\usage{
-geomean(x, na.rm = TRUE)
+geomean(x, na.rm = FALSE)
}
\arguments{
\item{x}{Vector of numbers}
@@ -17,8 +17,9 @@ The geometric mean
\description{
Based on some posts in a thread on Stackoverflow
\url{http://stackoverflow.com/questions/2602583/geometric-mean-is-there-a-built-in}
-This function checks for negative values, removes NA values per default and
-returns 0 if at least one element of the vector is 0.
+This function returns NA if NA values are present and na.rm = FALSE
+(default). If negative values are present, it gives an error message.
+If at least one element of the vector is 0, it returns 0.
}
\examples{
geomean(c(1, 3, 9))

Contact - Imprint