num_squeeze: Squeezing numeric values within specified range

Description Usage Arguments Value Examples

Description

Coerces numbers outside the specified range to the min or max value. low and high arguments default to '-Inf' and 'Inf' Function will return NULL if lower

Usage

1
num_squeeze(x, low = -Inf, high = Inf)

Arguments

x

vector of numeric values

low

lower limit of numeric range

high

upper limit of numeric range

Value

numeric vector

Examples

1
2
3
4
5
6
7
x = -100:100

num_squeeze(x)
num_squeeze(x, low = 0)
num_squeeze(x, low = -1e3, high = 1e3)
num_squeeze(x, low = -2, high = -5) #returns NULL with warning
num_squeeze(x, low = 0, high = 0)

Ajfrick/AVRCHelp documentation built on May 28, 2019, 1:34 a.m.