Skip to contents

Replace Values Below a Given Threshold

Usage

replace_threshold(x, y, threshold, ...)

# S4 method for class 'numeric,numeric,function'
replace_threshold(x, y, threshold, value = 0, ...)

# S4 method for class 'ANY,missing,function'
replace_threshold(x, threshold, value = 0, ...)

# S4 method for class 'numeric,numeric,numeric'
replace_threshold(x, y, threshold, value = 0, ...)

# S4 method for class 'ANY,missing,numeric'
replace_threshold(x, threshold, value = 0, ...)

Arguments

x, y

A numeric vector. If y is missing, an attempt is made to interpret x in a suitable way (see grDevices::xy.coords()).

threshold

A numeric value or a function that takes a numeric vector as argument and returns a single numeric value.

...

Extra parameters to be passed to threshold.

value

A numeric value to replace values below threshold.

Value

Returns a list with two components x and y.

See also

Other replacement methods: replace_negative()

Author

N. Frerebeau