Learn R Programming

wrMisc (version 1.15.3.1)

.minDif: find closest neighbour to numeric vector

Description

This function aims to find closest neighbour to numeric vector

Usage

.minDif(z, initOrder = TRUE, rat = TRUE)

Value

This function returns a matrix with index,value,dif,best

Arguments

z

(numeric) vector to search minimum difference

initOrder

(logical) return matrix so that 'x' matches exactely 2nd col of output

rat

(logical) express result as ratio

See Also

Examples

Run this code
.minDif(c(11:15,17))

Run the code above in your browser using DataLab