mean: Generic mean (?)

Description Usage Arguments Value Examples

View source: R/mean.R

Description

Generic interactive function for the arithmetic, weighted, geometric, armonic or arithmetic-geometric mean.

Usage

1
mean (x, type)

Arguments

x

An R object. Currently there are methods for numeric/logical vectors and date, date-time and time interval objects.

type

A number from 1 to 5 that identifies which type of mean the user wants to calculate.

Value

The arithmetic, weighted, geometric, armonic or arithmetic-geometric mean of the values in x is computed, as a numeric or complex vector of length one. If x is not logical (coerced to numeric), numeric (including integer) or complex, NA_real_ is returned, with a warning.

Examples

1
2
x <- c(13:20, -31.2, 4321, -24)
mean(x, type = 1) # don't input the "type", R will ask you what you want anyways.

PaoloDalena/eviltools documentation built on Jan. 4, 2021, 10:41 a.m.