Learn R Programming

geomorph (version 2.0.1)

plotTangentSpace: Plot specimens in tangent space

Description

Function plots a set of Procrustes-aligned specimens in tangent space along their principal axes

Usage

plotTangentSpace(A, axis1 = 1, axis2 = 2, warpgrids = TRUE, mesh = NULL,
  label = FALSE, groups = NULL, verbose = FALSE)

Arguments

A
An array (p x k x n) containing landmark coordinates for a set of aligned specimens
warpgrids
A logical value indicating whether deformation grids for shapes along X-axis should be displayed
mesh
A mesh3d object to be warped to represent shape deformation along X-axis (when {warpgrids=TRUE}) as described in plotRefToTarget.
axis1
A value indicating which PC axis should be displayed as the X-axis (default = PC1)
axis2
A value indicating which PC axis should be displayed as the X-axis (default = PC2)
label
A logical value indicating whether labels for each specimen should be displayed
groups
An optional factor vector specifying group identity for each specimen
verbose
A logical value indicating whether the output is basic or verbose (see Value below)

Value

  • Function returns a table summarizing the percent variation explained by each pc axis (equivalent to summary() of prcomp) (default, verbose = FALSE). If verbose=TRUE, function returns a list containing the following components:
  • pc.summaryA PC summary table as above
  • pc.scoresThe set of principal component scores for all specimens.
  • pc.shapesA list with four components of the shape coordinates of the extreme ends of axis1 and axis2 is returned, which can be used by warpRefMesh.

Details

The function performs a principal components analysis of shape variation and plots two dimensions of tangent space for a set of Procrustes-aligned specimens (default is PC1 vs. PC2). The percent variation along each PC-axis is returned. Additionally (and optionally, {warpgrids=T}), deformation grids can be requested, which display the shape of specimens at the ends of the range of variability along PC1. If groups are provided, specimens from each group are plotted using distinct colors based on the order in which the groups are found in the dataset, and using R's standard color palette: black, red, green, blue, cyan, magenta, yellow, and gray.

Examples

Run this code
data(plethodon)
Y.gpa<-gpagen(plethodon$land)    #GPA-alignment
ref<-mshape(Y.gpa$coords)

plotTangentSpace(Y.gpa$coords, groups = paste(plethodon$species, plethodon$site))

Run the code above in your browser using DataLab