neighbors {labdsv}R Documentation

Neighbors

Description

Calculates the nearest neighbors in a distance/dissimilarity matrix

Usage

neighbors(dis,numnbr)

Arguments

dis

an object of class ‘dist’ such as returned by dist, vegdist or dsvdis

numnbr

the number (order) of neighbors to return

Details

For each sample unit in a dissimilarity matrix finds the ‘numnbr’ nearest neighbors and returns them in order.

Value

Returns a data.frame with sample units as rows and neighbors as columns, listed in order of proximity to the sample unit.

Author(s)

David W. Roberts droberts@montana.edu

Examples

data(bryceveg) # returns a data.frame called veg
dis.bc <- dsvdis(bryceveg,'bray/curtis')
neighbors(dis.bc,5)

[Package labdsv version 2.1-0 Index]