clip.val: Clip numeric values to a given range

Description Usage Arguments Details Value Author(s) Examples

View source: R/r-utility-clip.R

Description

This function clips numeric values in an input vector to a specified range. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1

Arguments

v

a numeric vector

min

the minimum value

max

the maximum value

Details

The min and max arguments specify the permitted range of values in v and all values outsided this range are clipped to this range.

Value

A copy of v with all values below min replaced by min and all values above max replaced by max.

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

Examples

1
clip.val(1:20, 5, 15)

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.