powered by
Calculates the nearest neighbors in a distance/dissimilarity matrix
neighbors(dis,numnbr)
Returns a data.frame with sample units as rows and neighbors as columns, listed in order of proximity to the sample unit.
an object of class ‘dist’ such as returned by dist, vegdist or dsvdis
dist
vegdist
dsvdis
the number (order) of neighbors to return
David W. Roberts droberts@montana.edu
For each sample unit in a dissimilarity matrix finds the ‘numnbr’ nearest neighbors and returns them in order.
data(bryceveg) # returns a data.frame called veg dis.bc <- dsvdis(bryceveg,'bray/curtis') neighbors(dis.bc,5)
Run the code above in your browser using DataLab