View source: R/geomorph.ordination.R
geomorph.ordination | R Documentation |
Takes geomorph Procrustes object or a geomorph.data.frame object and ordinates it.
geomorph.ordination(data, ordinate = TRUE, ...)
data |
An array (p x k x n) typically obtained from a Procrustes superimposition |
ordinate |
Logical, whether to ordinate the data using |
... |
Any optional arguments to be passed to |
If data
is a geomorph.data.frame
object containing factors, directly performs a custom.subsets
using these factors.
A matrix
or a dispRity
object.
geomorph::gpagen
, geomorph::morphol.disparity
, prcomp
, custom.subsets
, chrono.subsets
, boot.matrix
, dispRity
.
## Not run: require(geomorph) ## Loading the plethodon dataset data(plethodon) ## Performing a Procrustes transform procrustes <- geomorph::gpagen(plethodon$land, PrinAxes = FALSE) ## Obtaining the ordination matrix geomorph.ordination(procrustes) ## Using a geomorph.data.frame geomorph_df <- geomorph.data.frame(procrustes, species = plethodon$species) geomorph.ordination(geomorph_df) ## Calculating disparity from dispRity or geomorph::morphol.disparity geomorph_disparity <- geomorph::morphol.disparity(coords ~ 1, groups= ~ species, data = geomorph_df) dispRity_disparity <- dispRity(geomorph.ordination(geomorph_df), metric = function(X) return(sum(X^2)/nrow(X))) ## Extracting the raw disparity values geomorph_val <- round(as.numeric(geomorph_disparity$Procrustes.var), 15) dispRity_val <- as.vector(summary(dispRity_disparity, digits = 15)$obs) ## Comparing the values (to the 15th decimal!) geomorph_val == dispRity_val # all TRUE ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.