closest_index: Computes the index that places the value in the vector

Description Usage Arguments Value

View source: R/misc.R

Description

This is not like findInterval which places by order. Here order is irrelevant.

Usage

1
closest_index(vec, val)

Arguments

vec

vector of numeric values to search

val

the val to match into vec

Value

1-based index of the closest match in vec


BigelowLab/namanl documentation built on Nov. 15, 2021, 3:11 p.m.