match_numerics: Best-possible match of two numeric vectors

View source: R/match_numerics.R

match_numericsR Documentation

Best-possible match of two numeric vectors

Description

This function matches the indices of two numeric vectors as good as possible (that means with the smallest possible sum of deviations).

Usage

match_numerics(x, y)

Arguments

x, y

[numeric()]
Two vectors of the same length.

Value

An integer vector of length length(x) with the positions of y in x.

See Also

Other vector helpers: check_numeric_vector(), check_probability_vector(), chunk_vector(), insert_vector_entry(), permutations(), split_vector_at(), subsets(), vector_occurrence()

Examples

x <- c(-1, 0, 1)
y <- c(0.1, 1.5, -1.2)
match_numerics(x, y)

oeli documentation built on Oct. 16, 2024, 5:08 p.m.