Learn R Programming

VanillaICE (version 1.34.0)

threshold: Threshold numeric values

Description

Threshold numeric values according to user-specific limits. The thresholded values can also be jittered near the limits.

Usage

threshold(x, lim = c(-Inf, Inf), amount = 0)

Arguments

x
numeric matrix or vector
lim
limit at which to threshold entries in x
amount
see jitter

See Also

jitter

Examples

Run this code
x <- rnorm(1000, 0, 3)
y <- threshold(x, c(-5,5))
range(y)

Run the code above in your browser using DataLab