arithmeticmean: Calculating the Arithmetic Mean

Description Usage Arguments Value Examples

Description

Calculates the arithmetic mean of a set of numbers. The function adds up the numbers in the vector and divides by the number of elements in the vector.

Usage

1
arithmeticmean(input, na.rm = FALSE)

Arguments

input

a vector of numbers

na.rm

true or false for whether to remove NA's before performing the calculation

Value

A number

Examples

1
2
3
4
5
6
7
8
a <- c(-4,9,1,-6)
arithmeticmean(a)

b <- c(-4,NA,NA,9,1,-6)
arithmeticmean(b)

d <- c(-4,NA,NA,9,1,-6)
arithmeticmean(d,na.rm=T)

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