mea_na_thres: Arithmetic mean with percentage threshold for NA values.

Description Usage Arguments Value Examples

View source: R/functs_na.R

Description

Function for arithmetic mean automatically handling NAs. Calculates arithmetic mean value only when percentage of NAs is below given threshold.

Usage

1
mea_na_thres(x, na_thres = 0.5)

Arguments

x

see arguments in R documentation for mean.

na_thres

threshold value for percentage NAs in x; between 0 and 1

Value

The arithmetic mean of values in x.

Examples

1
2
mea_na_thres(c(2 ,3, 4, NA), na_thres=0.5)
mea_na_thres(c(2 ,3, 4, NA), na_thres=0.1)

ERottler/alptempr documentation built on May 7, 2021, 1:12 a.m.