nsink_get_closest: Get closest

View source: R/utils.R

nsink_get_closestR Documentation

Get closest

Description

This function will return the index of one vector that is closest, by absolute values, to the values in another vector. Usually used to identify the closest lake or stream, in area or length respectively, to another lake or stream.

Usage

nsink_get_closest(v1, v2)

Arguments

v1

The first vector of values, likely length or area of a feature

v2

The second vector of values, also likely length or area of a feature.

Value

Returns a vector, of length v1, of the index from v2 that is closest in absolute value to each value in v1.


USEPA/nsink documentation built on Feb. 8, 2025, 12:27 p.m.