plotOutliers | R Documentation |
Function plots all specimens ordered by distance from the mean.
plotOutliers(A, groups = NULL, PC = NULL, inspect.outliers = FALSE)
A |
A 3D array (p x k x n) containing Procrustes shape variables for a set of specimens |
groups |
An optional factor defining groups |
PC |
A single number or range of principal components that can be used to check for outliers. If NULL, all shape dimensions are used. This argument might be useful for investigating subtle but important aspects of shape that would not elucidate outliers in all dimensions. |
inspect.outliers |
A logical value indicating whether to plot outlier shape configurations as compared to the consensus |
The function creates a plot of all specimens ordered by their distance from the mean shape. There
is an option for using specified principal components (PC) of shape. If all shape dimensions are used
then distances are equal to Procrustes distances or distances in the tangent space of shape space that
resemble Procrustes distances, depending on whether the projection was performed with generalized
Procrustes analysis (GPA). Once distances are calculated, a power-transformation is perfomed to
normalize the distances. From these data, an upper limit is estimated following Tukey's box-plot rule,
as Q_3 + 1.5 \times (Q_3 - Q_1)
, where Q
refers to quartile. This upper limit is back-transformed
to distance, and any distances greater than this limit are colored red. (Note: These shapes could
be considered outliers but their red color does not mean they are necessarily outliers. )
The user may optionally
also inspect the shapes of identified configurations as compared to the consensus, in order
to identify potential digitization errors or other data issues. The addresses of all specimens are
returned in the order displayed in the plot for further inspection by plotRefToTarget
.
If the data have strong group structure and there is reasonable belief that the whole sample mean should not be used, then a factor defining the groups can be used.
Function returns the landmark addresses of all specimens ordered as in the plot. If groups are used, function returns a list structure and a plot for each level in groups.
Emma Sherratt, Antigoni Kaliontzopoulou, & Michael Collyer
gpagen
plotAllSpecimens
## Not run:
data(plethodon)
# let's make some outliers
newland <- plethodon$land
newland[c(1,8),,2] <- newland[c(8,1),,2]
newland[c(3,11),,26] <- newland[c(11,3),,2]
Y <- gpagen(newland) # GPA
out <- plotOutliers(Y$coords) # function returns dimnames and address
out
# of all specimens ordered
plotOutliers(Y$coords, inspect.outliers = TRUE) # function also produces
# plots of identified outlier specimens compared to the mean shape
# example with groups
plotOutliers(Y$coords, groups = plethodon$species,
inspect.outliers = TRUE)
# previous example using first three PCs of shape
plotOutliers(Y$coords, groups = plethodon$species,
PC = 1:3, inspect.outliers = TRUE)
# previous example using just the first PC of shape
plotOutliers(Y$coords, groups = plethodon$species,
PC = 1, inspect.outliers = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.