PlotVariations {Evomorph} | R Documentation |
Plot shapes
Description
Plot the differences between a set of morphometric shapes and a reference
Usage
PlotVariations(shapes, reference, path, save = F, w = 6, h = 6, d = 100, c_ref = "red",
c_target = "black", s_ref = 3, s_target = 2)
Arguments
shapes |
Landmark data of shapes (list of matrices) |
reference |
Landmark data of reference shape (matrix type) |
path |
Path where results will be saved (Default: working directory) |
c_ref |
Color of the points representing the reference shape (Default |
c_target |
Color of the points representing the target shape (Default |
s_ref |
Size of the points representing the reference shape (Default |
s_target |
Size of the points representing the target shape (Default |
save |
A logical value. If TRUE, the function will save the plot as jpeg images in the indicated in |
This parameters are used to modify stored graph (save = TRUE
):
w |
Units of width of the graph in inches (Default |
h |
Units of height of the graph in inches(Default |
d |
Number of dpi (resolution) of the graph. (Default |
Details
The function uses package ggplot2 (Wickman 2009) to create multiple plots representing the variations between a list of target shapes and a reference (consensus shape or another specimen data). If save=TRUE
it creates a folder (named day_hh_mm) and stores the plots as images (.jpeg) at the provided path (if not provided it will store them in the working directory).
There are several parameters for modify the graph for a suitable representation. This function could be used for example to analyze morphological variations of species over generations.
Author(s)
Cabrera Juan Manuel
References
H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.
See Also
Examples
data("aegla_consensus")
data("simulated_shapes")
#Sample one individual from simulated_shapes dataset
simu<-simulated_shapes[100]
#Create a shape variation graphic
graph<-PlotVariations(simu,aegla_consensus)
#Red dots represent the landmark coordinates of the reference shape and black
# dots represent the target shape. The length of the segments represent
# distances between pairs of homologous landmarks
graph[[1]]