filt {StabPerf}R Documentation

Filters out data points that follow below or above given cutoffs.

Description

Removes extreme values from data sets, by either setting them to the given cutoff values or setting them to NA

Usage

filt(data, lower=-Inf, upper=+Inf, to_lower=lower, to_upper=upper, to.na=T)

Arguments

data numeric.
lower numeric. Lower limit.
upper numeric. Upper limit.
to_lower numeric. Values below lower will be reset to this value.
to_upper numeric. Values above upper will be reset to this value.
to.na logical. Should extreme values be set to NA instead of being adjusted.

Details

The class of the return value will be the same as the class of data, as long there is a as.class() function defined for the class of data.

Value

filtered. numeric. Vector of the same length as the input data

See Also

class

Examples

# All values below 0.2 are set to 0.2, all values above 0.8 are set to NA
filtered <- filt(rnorm(1:100), lower=.2, upper=.8, to_lower=TRUE)

[Package StabPerf version 0.5 Index]