closestMatch: Find closest match in a vector

View source: R/closestMatch.R

closestMatchR Documentation

Find closest match in a vector

Description

Find closest match in a vector

Usage

closestMatch(x, y)

Arguments

x

numeric vector

y

vector of numeric values, each of which will be matched with the closest value in x

Value

numeric vector of values of x that are closest to each element of y

Examples

x <- seq(1, 5, 0.3)
y <- seq(0, 6, 0.25)
closestMatch(x, y)


johngodlee/JLGMisc documentation built on June 29, 2024, 9:15 p.m.