nearestspecies: Find nearest species compositional neighbors among two...

Description Usage Arguments Details Value References Examples

Description

Given two species abundance matrices (of possibly unequal size), find nearest species compositional neighbors.

Usage

1
nearestspecies(spe1, spe2, method, ties = FALSE, ...)

Arguments

spe1

species abundance matrix with greater number of sites (rows)

spe2

species abundance matrix with lesser number of sites (rows)

method

dissimilarity index, per vegdist; default uses Bray-Curtis dissimilarities with stepacross adjustment

ties

logical, should ties (non-unique values) be allowed? default is FALSE

...

additional arguments passed to function

Details

Useful to subset the longer of two datasets for analyses that require compatible dimensions (e.g., mantel, procrustes).

If ties = FALSE, then all returned values are unique; if ties = TRUE, then unique values are not enforced, so any sample unit in spe1 may be picked repeatedly.

Example of first use is in Smith and Gray (2018).

Value

Numeric vector indexing rows (sample units) in spe1 which are nearest compositional neighbors of spe2. The order corresponds to row order in spe2.

References

Smith, R. J., and A. N. Gray. 2018. Combining potentially incompatible community datasets when harmonizing forest inventories in subarctic Alaska. Journal of Vegetation Science: accepted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# two candidate datasets, full and partial
set.seed(181)
data(smoky)
full <- smoky$spe
part <- (full + abs(rnorm(prod(dim(full)), 0, 25)))[1:6,]

# subset the full matrix, based on compositional nearest neighbors
i <- nearestspecies(full, part, ties=FALSE)
i
full <- full[i,,]

# default is to break ties
nearestspecies(full, part, ties=FALSE)
nearestspecies(full, part, ties=TRUE)

phytomosaic/ecole documentation built on Dec. 7, 2018, 6:06 p.m.