neighbors: Find Nearest Neighbor Distances

Description Usage Arguments Value

View source: R/neighbors.R

Description

Given one (or two) multivariate data sets, a difference method, and k neighbors to search for, neighbors finds the k points in the data set (or the second data set) that are closest to each point in the data set (or the first data set)

Usage

1
neighbors(X, Y = NULL, method = "euclidean", n.neighbors = 1, init.info = NULL)

Arguments

X

a matrix of numeric values

Y

an optional second matrix that must have the same number of columns as X

method

one of the method choices from diss

n.neighbors

an integer between 1 and nrow(X) (or nrow(Y), if it is not null)

init.info

some difference methods require additional information. see diss

Value

returns an nrow(X) by n.neighbors matrix of distances


dissUtils documentation built on May 1, 2019, 7:28 p.m.