mindiff: Find the minimum difference between a vector and a set of...

View source: R/mindiff.R

mindiffR Documentation

Find the minimum difference between a vector and a set of choices.

Description

Find the minimum difference between a vector and a set of choices.

Usage

mindiff(x, choices, tie = c("first", "last", "median-first", "median-last"))

Arguments

x

The vector of values to adjust

choices

The vector of values which should be matched

tie

How should a tie (two choices are equidistant) be managed? (See details.)

Value

The vector of x replaced by the closest values from the choices vector.

See Also

mindiff_after


billdenney/bsd.report documentation built on Jan. 16, 2024, 12:54 a.m.