constrain: Constrain Data to a Specified Range

Description Usage Arguments Value Examples

Description

Constrain data to a specified range, assigning values from the specified range to those outside the range, typically for graphing purposes.

Usage

1
constrain(x, xrange)

Arguments

x

A numeric vector of values to constrain.

xrange

A numeric vector of length two specifying the constraints, the minimum and maximum value for x.

Value

A numeric vector, the same length as x, in which the minimum constraint is assigned to values of x less than the minimum, and the maximum constraint is assigned to values of x greater than the maximum.

Examples

1
constrain(1:20, c(3, 19))

LW1949 documentation built on May 2, 2019, 6:11 a.m.