which.closest {birk}R Documentation

Where is the closest?

Description

Returns index of the closest value to x.

Usage

which.closest(vec, x)

Arguments

vec

a numeric vector.

x

numeric. The value for which the closest match should be returned.

Author(s)

Matthew A. Birk, matthewabirk@gmail.com

See Also

which.min, which.max

Examples

which.closest(10:1, 3.3)


[Package birk version 2.1.2 Index]