Learn R Programming

geomorph (version 3.1.2)

plotOutliers: Find potential outliers

Description

Function plots all specimens ordered by distance from the mean.

Usage

plotOutliers(A, groups = NULL, inspect.outliers = FALSE)

Arguments

A

A 3D array (p x k x n) containing Procrustes shape variables for a set of specimens

groups

An optional factor defining groups

inspect.outliers

A logical value indicating whether to plot outlier shape configurations as compared to the consensus

Value

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.

Details

The function creates a plot of all specimens ordered by their Procrustes distance from the mean shape. The median distance (unbroken line) and upper and lower quartiles (dashed lines) summarize the distances from the mean shape. Specimens falling above the upper quartile are plotted in red. The user may optionally also inspect the shapes of identified outlier configurations as compared to the consensus, in order to identify 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.

See Also

gpagen

plotTangentSpace

plotAllSpecimens

Examples

Run this code
# 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 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)
 
# }

Run the code above in your browser using DataLab