clamp: clamp

View source: R/clamp.R

clampR Documentation

clamp

Description

clamp values in the range of lims

Usage

clamp(x, lims = c(0, 1), fill.na = FALSE)

clamp_min(x, value = 0)

clamp_max(x, value = 0)

Arguments

x

Numeric vector

lims

limits

fill.na

If true, values of lims are set to NA; else, values are just constrained in the range of lims.

Examples

clamp(1:10, lims = c(4, 7), fill.na = TRUE) 

rpkgs/Ipaper documentation built on March 24, 2024, 3:09 p.m.