trunc: truncate the values in a vector

Description Usage Arguments Value Author(s) Examples

Description

truncate the values in a vector

Usage

1
trunc(x, limits)

Arguments

x

a numeric vector

limits

a numeric(2) indicating the min and max value. If either is NA, then data will not be truncated at the min or max.

Value

a numeric vector, same length as x, with values no smaller than limits[1] and no larger than limits[2]

Author(s)

Mark Cowley, 2011-11-29

Examples

1
2
3
4
x <- rnorm(20, 0, 2)
trunc(x, c(-1,1))
trunc(x, c(-1,NA))
trunc(x, c(NA,1))

drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.