MDSaddpoints | R Documentation |
Add new points to an existing metaMDS
or
monoMDS
ordination.
MDSaddpoints(nmds, dis, neighbours = 5, maxit = 200)
dist2xy(dist, pick, type = c("xy", "xx"), invert = FALSE)
nmds |
Result object from |
dis |
Rectangular non-symmetric dissimilarity matrix among new
points (rows) and old fixed points (columns). Such matrix can be
extracted from complete dissimilarities of both old and new points
with |
neighbours |
Number of nearest points used to get the starting locations for new points. |
maxit |
Maximum number of iterations. |
dist |
Input dissimilarities. |
pick |
Indices (integers) of selected observations or a logical
vector that is |
type |
|
invert |
Invert |
Function provides an interface to monoMDS
Fortran code to add new
points to an existing ordination that will be regarded as fixed. The
function has a similar role as predict
functions with
newdata
in Euclidean ordination (e.g. predict.cca
).
Input data must be a rectangular matrix of distances among new added
points (rows) and all fixed old points (columns). Such matrices can be
extracted from complete dissimilarities with helper function
dist2xy
. Function designdist2
can directly
calculate such rectangular dissimilarity matrices between sampling units
(rows) in two matries. In addition, analogue has distance
function that can calculate dissimilarities among two matrices,
including functions that cannot be specified in
designdist2
.
Great care is needed in preparing the dissimilarities for the input. The dissimilarity index must be exactly the same as in the fixed ordination, and columns must match old fixed points, and rows added new points.
Function return a list of class "nmds"
(there are no other
objects of that type in vegan) with following elements
points |
Coordinates of added new points |
seeds |
Starting coordinates for new points. |
deltastress |
Change of stress with added points. |
iters |
Number of iterations. |
cause |
Cause of termination of iterations. Integer for
convergence criteria in |
## Cross-validation: remove a point when performing NMDS and add as
## a new points
data(dune)
d <- vegdist(dune)
## remove point 3 from ordination
mod3 <- metaMDS(dist2xy(d, 3, "xx", invert = TRUE), trace=0)
## add point 3 to the result
MDSaddpoints(mod3, dist2xy(d, 3))
## Use designdist2
d15 <- designdist(dune[1:15,])
m15 <- metaMDS(d15, trace=0)
MDSaddpoints(m15, designdist2(dune[1:15,], dune[16:20,]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.