avg: Compute mean by ignoring NAs

Description Usage Arguments Value Examples

View source: R/juantools.R

Description

Compute mean, with option na.rm=TRUE by default

Usage

1
avg(x)

Arguments

x

Numeric vector

Value

Mean of x values, ignoring NAs

Examples

1
2
3
x = c(2, 5, NA, 7)
mean(x)
avg(x)

juanfung/juantools documentation built on Jan. 1, 2021, 7:12 a.m.