Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Geomorph users,

A new function in geomorph 2.1.3 allows the user to explore Procrustes superimposed data for outliers (plotOutliers). Here I shall provide a few example for loops to demonstrate how you can explore your data for outliers prior to analyses.

1) plotTangentSpace to visualise aberrant individuals

To label all the individuals in the biplot so strong outliers can be identified:
plotTangentSpace(coords, labels = dimnames(coords)[])#

If your data has group structure (e.g. species), make a factor for this grouping variable then you can plot each level at a time using:

for(i in levels(group)){
plotTangentSpace(coords[,,which(group == i)],
label = dimnames(coords)[][which(group == i)])}

2) plotOutliers to find outliers by ordering individuals by their distance from the mean

outliers <- plotOutliers(coords)

If you have a lot of specimens, make a PDF of all specimens plotted as vector shape change graphs:

outliers <- plotOutliers(coords)
pdf(“AllSpecimens.pdf”)
for(i in 1:length(outliers)){ plotRefToTarget(mshape(coords), coords[,,outliers[i]],
method=”vector”, label = T) title(names(outliers[i]))}
dev.off()

If your data has group structure, make a factor for this grouping variable then you can  examine outliers for each level at a time using:

for(i in levels(group)){
outliers <- plotOutliers(coords[,, which(group == i)])
title(i) }

Combining these two makes a PDF for each level in the group with the summary graph and the shape change graphs:

for(i in levels(group)){
outliers <- plotOutliers(coords[,, which(group == i)])
title(i)
pdfname <- paste(i, ".pdf", sep="")
pdf(pdfname)
plotOutliers(coords[,, which(group == i)])
for(j in 1:length(outliers)){
plotRefToTarget(mshape(coords), coords[,,outliers[j]], method=”vector”, label = T)
title(names(outliers[j]))
}
dev.off()
}

Emma