Description Usage Arguments Details Value Examples
Given two species abundance matrices (of possibly unequal size), find nearest species compositional neighbors.
1 | nearestspecies(spe1, spe2, method, ties = FALSE, ...)
|
spe1 |
species abundance matrix with greater number of sites (rows) |
spe2 |
species abundance matrix with lesser number of sites (rows) |
method |
dissimilarity index, per
|
ties |
logical, should ties (non-unique values) be allowed?
default is |
... |
additional arguments passed to function |
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.
Numeric vector indexing rows (sample units) in spe1
which
are nearest compositional neighbors of spe2
. The order
corresponds to row order in spe2
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.