trim_val: trim vector to lower or upper value

Description Usage Arguments Value Examples

View source: R/utils.r

Description

the range a value may take is resticted to by an upper and lower boundary. If it excedd the boundary the value is replaced by the boundary value or alternatively by NA

Usage

1
trim_val(x, minmax = c(-Inf, Inf), na = FALSE)

Arguments

x

numeric vector

minmax

minimal and maximal possible value (default c(-Inf, Inf) i.e. no trimming occurs)

na

Use NAs for replacing values that are out of range

Value

vector vector whose elemenets that are out of range are replaced

Examples

1
2
trim_val(30)
trim_val(30, c(10,20))

markheckmann/OpenRepGrid documentation built on April 30, 2021, 2:33 a.m.