plotOutliers_percentile: plotOutliers_percentile

plotOutliers_percentileR Documentation

plotOutliers_percentile

Description

This function has been adapted from the plotOutliers function in geomorph. It has been modified to select for percentiles and save plots.

Usage

plotOutliers_percentile(A, groups = NULL, inspect.outliers = FALSE, percentile, save.plot = FALSE)

Arguments

A

Same as in the plotOutliers function in geomorph. An object of the class "array" that contains Procrustes shape variables for 'n' specimens

groups

Same as in the plotOutliers function in geomorph. An optional factor defining groups

inspect.outliers

Same as in the plotOutliers function in geomorph. A logical value indicating whether to plot outlier shape configurations as compared to the consensus

percentile

A numerical value indicating the prefered percentile (e.g. 95)

save.plot

A logical value indicating whether to save the plots in the current working directory.

Details

This function is highly based on the plotOutliers function in geomorph (Adams et al., 2018), and it has been modified to select for percentiles and save plots (including a histogram). It will check for outliers at the selected percentile (e.g. 95).

Value

This function returns a list with two objects and plots two different plots. The first object in the list ($All_Proc_d) contains all the Procrustes distances to the mean shape. The second object on the list ($Proc_d_percentile) only contains Procrustes distances from the potential outliers. The first plot is exactly the same as in the plotOutliers function in geomorph (Adams et al., 2018): all specimens are plotted in order by their Procrustes distance from the mean shape. Both the median distance (unbroken blue line) and the percentile (dashed blue line) summarize the distances from the mean shape. Specimens falling above the selected percentile are plotted in red, like in the plotOutliers function in geomorph (Adams et al., 2018). The second plot is a histogram, that shows the frequency of different prouped values of Procrustes distance from the mean shape. The abline separates the values based on the selected percentile (dashed blue line).

Author(s)

Marta Vidal-Garcia

References

Adams, D. C., M. L. Collyer, and A. Kaliontzopoulou. 2018. Geomorph: Software for geometric morphometric analysis. R package version 3.0.6. Available at http://CRAN.R-project.org/package=geomorph.

Examples

 # species <- c("sp_A", "sp_A", "sp_B", "sp_A", "sp_A", "sp_B", "sp_B", "sp_A", "sp_A", "sp_A", "sp_A")
 # plotOutliers_percentile(GPA$coords, percentile = 0.95) 
 # plotOutliers_percentile(GPA$coords, percentile = 0.99, groups = species, save.plot = TRUE)
  

marta-vidalgarcia/morpho.tools.GM documentation built on April 7, 2023, 12:54 a.m.