neighborhoods {intrinsicDimension} | R Documentation |
Obtaining neighborhoods (local data) from a data set
Description
Get a list of neighborhoods, each containing the k
nearest neighbors (not including itself) to a point in the data set.
Usage
neighborhoods(data, k, indices, eps=0.0)
Arguments
data |
A data set. |
k |
The number of neighbors in each neighborhood. |
indices |
A vector with indices of the points in |
eps |
If non-zero, the relative error in distance allowed when finding nearest neighbors. See Details. |
Details
The ann
function of the package yaImpute
is used for finding the k
nearest neighbors. The eps
parameter to neighborhoods
is used in the ann
function.
Value
A list of neighborhoods where each item corresponds to one index in indices
and each item contains a data set with k
data points.
Author(s)
Kerstin Johnsson, Lund University
Examples
data <- swissRoll3Sph(300, 300)
neighborhoods(data, 10, 1:10)
[Package intrinsicDimension version 1.2.0 Index]