CalcMeanMinrm: Calculate mean with enforced minimum valid value.

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

CalcMeanMinrm calculates a mean with an enforced minimum valid value. Read a vector and calculate the mean with all values below a specified minimum value set to NA (and therefore ignored).

Usage

1
CalcMeanMinrm(x, minValid = -1e+30)

Arguments

x

The vector of values.

minValid

The minimum valid value.

Value

The mean.

Examples

1
2
3
x <- c(1,2,-1e+20,3)
mean(x) # yields -2.5e+19
CalcMeanMinrm(x, 0) # yields 2

mccreigh/rwrfhydro documentation built on May 12, 2018, 3:08 a.m.