clip_within_range: Clip a vector to lie within a range

View source: R/ranges.R

clip_within_rangeR Documentation

Clip a vector to lie within a range

Description

This function clips a vector to lie within a range.

Usage

clip_within_range(x, range)

Arguments

x

A vector, to be clipped.

range

A vector of two numbers, used to clip x.

Value

A vector, as inputted, solely comprising values within the range specified by range, inclusive.

Author(s)

Edward Lavender

Examples

clip_within_range(1:10, c(5, 6))
clip_within_range(stats::runif(10, -10, 10), c(-9, 9))


edwardlavender/utils.add documentation built on Dec. 14, 2024, 8:11 a.m.