fclamp_int: Clamp an Integer Vector Within a Range

View source: R/RcppExports.R

fclamp_intR Documentation

Clamp an Integer Vector Within a Range

Description

This function clamps the values of an integer vector to lie within a specified range [a, b]. Values below a are set to a and values above b are set to b. Optionally, the operation can be performed in-place.

Usage

fclamp_int(x, a = 0L, b = 1L, inplace = FALSE)

Arguments

x

An integer vector to be clamped.

a

The lower bound (default is 0).

b

The upper bound (default is 1).

inplace

Logical flag indicating whether to modify the input vector in place (default is false).

Value

An integer vector with values clamped to the range [a, b].


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.