knn_dist.default: Default Method for K-Nearest Neighbors Distance

View source: R/knn_c.R

knn_dist.defaultR Documentation

Default Method for K-Nearest Neighbors Distance

Description

Computes the distance between two numeric vectors using the logarithmic difference.

Usage

## Default S3 method:
knn_dist(x, y)

Arguments

x

A numeric vector.

y

A numeric vector.

Details

This method calculates the logarithmic difference between elements of x and y. Note that this method assumes x and y are numeric and may produce warnings if there are negative values or zero.

Value

A numeric vector of distances between the elements of x and y, calculated as log(x - y).


COHHIO/hud.export documentation built on Sept. 6, 2024, 1:48 a.m.