Description Usage Arguments Details Value Examples
These functions calculate the arithmetic or geometric mean of a set of numbers.
1 2 | arithmeticmean(x)
geometricmean(x)
|
x |
A vector of numbers |
To calculate the arithmetic mean, each number in a vector is added up and then divided by the total number of entries in the vector. To calculate the geometric mean, each number is multiplied together and then the nth root is taken, where n is the number of entries in the vector.
Will return a number.
1 2 3 4 5 | a <- c(-3,6,11,-2)
arithmeticmean(a)
b <- c(3,9,5,8)
geometricmean(b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.