neighbors: Neighbors

neighborsR 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)

labdsv documentation built on April 10, 2023, 5:08 p.m.

Related to neighbors in labdsv...