diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2014-06-26 10:26:49 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2014-06-26 10:26:49 +0200 |
commit | e8cf8558b7d071f800a65c3688f19d5ae400c33f (patch) | |
tree | cfb3055c0b4c759794664a3b25a8a08beb3ac8ef /R | |
parent | 6fd8b2a1ef16265f12d54bb182393bdeaada2db4 (diff) |
Add function for geometric mean
Diffstat (limited to 'R')
-rw-r--r-- | R/geometric_mean.R | 4 |
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)) +} |