aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-06-26 10:26:49 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2014-06-26 10:26:49 +0200
commite8cf8558b7d071f800a65c3688f19d5ae400c33f (patch)
treecfb3055c0b4c759794664a3b25a8a08beb3ac8ef /R
parent6fd8b2a1ef16265f12d54bb182393bdeaada2db4 (diff)
Add function for geometric mean
Diffstat (limited to 'R')
-rw-r--r--R/geometric_mean.R4
1 files changed, 4 insertions, 0 deletions
diff --git a/R/geometric_mean.R b/R/geometric_mean.R
new file mode 100644
index 00000000..646732cd
--- /dev/null
+++ b/R/geometric_mean.R
@@ -0,0 +1,4 @@
+geometric_mean <- function(x, na.rm = FALSE)
+{
+ exp(mean(log(x), na.rm = na.rm))
+}

Contact - Imprint