Computes arithmetic mean of a vector with numeric or logical values.

my_mean(x, na.rm = TRUE, inf.rm = TRUE)

Arguments

x

A numeric or logical vector.

na.rm

Boolean specifying whether or not to remove NA and NaN values..

inf.rm

Boolean specifying whether or not to remove Inf values.

Value

The arithmetic mean of the values in x returned as a numeric vector of length one.

Examples

x <- 1:10 my_mean(x)
#> [1] 5.5