Learn R Programming

oce (version 0.2-1)

rangelimit: Substitute NA for data outside a range

Description

Substitute NA for data outside a range, e.g. to remove wild spikes in data.

Usage

rangelimit(x, min, max)

Arguments

x
vector of values
min
minimum acceptable value. If not supplied, and if max is also not supplied, a min of the 0.5 percentile will be used.
max
maximum acceptable value. If not supplied, and if min is also not supplied, a min of the 0.995 percentile will be used.

Examples

Run this code
ten.to.twenty <- rangelimit(1:100, 10, 20)

Run the code above in your browser using DataLab