Nearest_Neighbors: Nearest_Neighbors function

View source: R/Nearest_Neighbors.R

Nearest_NeighborsR Documentation

Nearest_Neighbors function

Description

Nearest_Neighbors function

Usage

Nearest_Neighbors(X, observation, K, method, p = NULL)

Arguments

X

n x m matrix

observation

1 x m vector which is a row of the matrix X

K

positive integer that is the number of nearest-neighbors

method

Which distance equation will be used to calculate the nearest-neighbors.

p

If supplied, the positive integer used in calculating the Minkowski distance

Value

A list with first item is the 1 x K vector of indices of the nearest-neighbors and the second item is the 1 x K vector of distances to the nearest-neighbors.


llrebecca21/ClusterPack documentation built on April 15, 2022, 4:37 a.m.