avg_mean: Calculate the weighted mean value of a vector.

Description Usage Arguments Value Examples

View source: R/vector_stats.R

Description

Calculate the weighted mean value of a vector.

Usage

1
avg_mean(x, weights = c())

Arguments

x

A vector.

weights

An optional vector of weights.

Value

The weighted mean of x.

Examples

1
2
avg_mean(c(1,2,3,4))
avg_mean(c(1,2,3,4), c(0.1, 0.2, 0.3, 0.4))

ajfabry/Statspeare documentation built on Jan. 26, 2020, 7:44 a.m.