NND: main function to compute one-dimensional nearest neighboring...

View source: R/Linda.R

NNDR Documentation

main function to compute one-dimensional nearest neighboring distance and conduct hypothesis testing for a single line transects

Description

find nearest neighbor distance for each distributional point from a single line transect and conduct hypothesis testing

Usage

NND(xy, L = NULL)

Arguments

xy

xy is two column matrix, the first is x coordinate, and the second is y coordinate. because for line transect sampling, individuals are collected from sequential sampling, so xy should be ordered in a time-forward way (backward is fine) In other words, rows of xy matrix should be sorted according to sampling sequential orders.

L

L is the length of the line transect, can be given or calculated from the original data (if L=NULL). L=NULL is recommended and set as a default, because the given line transect length might over-estimate the aggregation pattern!

Value

It returns the following quantities:

R

the one-dimensional NND ratio, which is the average of the observed one-dimensional NND versus the expected NND for a single targeted line transect

ra

the average of the observed NND for all distributional points for a single targeted line transect

re

the expected NND under one-dimensional perfect regularity pattern for a single line transect. More details can be referred to Chen et al. (2025)

sig

standard error for the targeted line transect

c

the Z score value for testing significance

p

the p value for testing significance

df

sample size, i.e., the total number of distributional points for analysis

L

the estimated or given line transect length

Note

in empirical data provided by the users themselves, because we assume individuals have been recorded in xy matrix in a sequential order, so the original data xy do not need to be sorted and just be used as input directly.

Author(s)

Youhua Chen

References

Xiaoqin Shi, Yongbin Wu, Qi Xiao, Youhua Chen (2026) Linda: an R package using Line transect-based nearest neighbor distance analysis to infer distributional aggregation pattern of species. Plant Diversity.

See Also

LNND

Examples

xy=cbind(sort(runif(100)),1) #sequentially sampled in an economic way
NND(xy)
#in empirical data, because we assume individuals have been recorded in sequential order
#so the original data do not need to be sorted.
#By contrast, in simulated data, if we assumed individuals are recorded in sequential order 
#and in an economic way
#sort() function should be used.

Linda documentation built on July 4, 2026, 9:07 a.m.