calc_mean: Mean computation

View source: R/calc_mean.r

calc_meanR Documentation

Mean computation

Description

Computation of the mean (arithmetic,geometric and harmonic).

Usage

calc_mean(
  x,
  type = c("arithmetic", "geometric", "harmonic"),
  trim = NULL,
  weight = NULL
)

Arguments

x

A numeric vector

type

A character single value

trim

A numeric single value, that will be the fraction of data to be trimmed from both ends

weight

A numeric vector, that will be the weights used for the weighted the arithmetic mean

Value

A numeric single value with the computed mean.

Examples


x <- rexp(100,.5)

calc_mean(x,"geometric")


vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.