closest.below: Find the closest value below 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 (greatest) value below 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.below(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 greatest less 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 greatest less value from v2 or -Inf if no such value exists.

Author(s)

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

See Also

closest.above

Examples

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

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