rray_clip: Bound the values of an array

Description Usage Arguments Value Examples

View source: R/clip.R

Description

rray_clip() sets inclusive lower and upper bounds on the values of x.

Usage

1
rray_clip(x, low, high)

Arguments

x

A vector, matrix, array or rray.

low

A single value. The lower bound. low is cast to the inner type of x.

high

A single value. The upper bound. high is cast to the inner type of x.

Value

x bounded by low and high.

Examples

1
2
3
# bound `x` between 1 and 5
x <- matrix(1:10, ncol = 2)
rray_clip(x, 1, 5)

r-lib/rray documentation built on Feb. 3, 2020, 8:14 p.m.