Skip to contents

Clips a numeric vector between two values.

Usage

ifelse_clip(lamb, x, y)

Arguments

lamb

Numeric vector. Values to be clipped.

x

Numeric. Lower bound of the clip range.

y

Numeric. Upper bound of the clip range.

Value

Numeric vector. Clipped values.

Examples

lamb <- c(1, 2, 3, 4, 5)
ifelse_clip(lamb, 2, 4)
#> [1] 2 2 3 4 4