Community phylogenetic ordination
ps_ordinate.Rd
Perform an ordination that reduces a spatial phylogenetic data set into k
dimensions, using one of
several alternative ordination algorithms.
Usage
ps_ordinate(ps, method = c("nmds", "cmds", "pca"), k = 3, spatial = TRUE)
Arguments
- ps
A
phylospatial
object with a non-nulldissim
component, generated by ps_add_dissim.- method
Ordination method, either "pca" (principal component analysis implemented via
stats::prcomp()
), "cmds" (classical MDS, implemented viastats::cmdscale()
), or "nmds" (the default, nonmetric MDS, implemented viavegan::metaMDS()
; this is slower but often preferred).- k
Positive integer giving the desired number of output dimensions; default is
3
.- spatial
Logical indicating whether a spatial object (inherited from
ps
) should be returned. Default is TRUE.
Examples
ps <- ps_add_dissim(ps_simulate(50, 5, 5))
ord <- ps_ordinate(ps, method = "cmds", k = 4)
terra::plot(ord)