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_ref="red")
c_target
Color of the points representing the target shape (Default c_target="black")
s_ref
Size of the points representing the reference shape (Default s_ref=3)
s_target
Size of the points representing the target shape (Default s_target=2)
save
A logical value. If TRUE, the function will save the plot as jpeg images in the indicated in path
This parameters are used to modify stored graph (save = TRUE):
w
Units of width of the graph in inches (Default w = 6)
h
Units of height of the graph in inches(Default h = 6)
d
Number of dpi (resolution) of the graph. (Default d = 6)
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
SimEvo
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]]
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Evomorph)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Evomorph/PlotVariations.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PlotVariations
> ### Title: Plot shapes
> ### Aliases: PlotVariations
>
> ### ** 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]]
>
>
>
>
>
> dev.off()
null device
1
>