closest.above: Find the closest value above a given threshold in a numeric...

Description Usage Arguments Details Value Author(s) See Also Examples

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

Description

This function finds in an input numeric vector the closest (least) value above a specified threshold. 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
closest.above(v1, v2)

Arguments

v1

a numeric vector of threshold values

v2

a numeric vector of input value

Details

For each threshold value in v1, the least greater input value from v2 is found and returned.

Value

A numeric vector of the same length as v1, containing for each element of v1 the least greater value from v2 or Inf if no such value exists.

Author(s)

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

See Also

closest.below

Examples

1
2
3
closest.above(1:5, 1:10)
closest.above(6:10, 1:10)
closest.above(2*(1:4), 1:10)

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