neighbors | R Documentation |
Calculates the nearest neighbors in a distance/dissimilarity matrix
neighbors(dis,numnbr)
dis |
an object of class ‘dist’ such as returned by
|
numnbr |
the number (order) of neighbors to return |
For each sample unit in a dissimilarity matrix finds the ‘numnbr’ nearest neighbors and returns them in order.
Returns a data.frame with sample units as rows and neighbors as columns, listed in order of proximity to the sample unit.
David W. Roberts droberts@montana.edu
data(bryceveg) # returns a data.frame called veg
dis.bc <- dsvdis(bryceveg,'bray/curtis')
neighbors(dis.bc,5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.