means: Means

Description Usage Arguments Details Value Examples

Description

These functions calculate the arithmetic or geometric mean of a set of numbers.

Usage

1
2

Arguments

x

A vector of numbers

Details

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.

Value

Will return a number.

Examples

1
2
3
4
5
a <- c(-3,6,11,-2)
arithmeticmean(a)

b <- c(3,9,5,8)
geometricmean(b)

Andy-McCarthy/BasicMath documentation built on May 27, 2019, 7:24 a.m.