find_index: find the closest index

View source: R/outqrf.r

find_indexR Documentation

find the closest index

Description

This function finds the closest index to a given value in a vector.

Usage

find_index(x, y)

Arguments

x

a vector

y

a value

Value

the index of the closest value in the vector

Examples

find_index(c(1, 2, 3, 4, 5), 3.5)

outqrf documentation built on Sept. 11, 2024, 8:47 p.m.