minmax: Bound values to a lower and upper limit

Description Usage Arguments Value Examples

View source: R/minmax.R

Description

Bound the values of x to lie within the upper and lower bounds.

Usage

1
minmax(x, lower, upper)

Arguments

x

vector of values to limit

lower, upper

lower and upper limits

Value

vector of the same length as x

Examples

1
2
3
4
set.seed(0)
c <- sample(-100:100, 20)
c
minmax(c, -10, 10)

jhrcook/jhcutils documentation built on Sept. 2, 2020, 7:16 a.m.