| plotSmoothsDevnBoxplots {growthPheno} | R Documentation | 
Produces boxplots for several sets of deviations of the smoothed values from a response, possibly along with growth rates.
Description
 Calculates and produces, using plotDeviationsBoxes, boxplots 
of the deviations of the supplied smoothed values from the observed response values for the 
traits and for combinations of the different smoothing parameters and for subsets of 
non-smoothing-factor combinations. Which traits are plotted is controlled by  
trait.types and may include the (responseand the computed traits of the 
Absolute Growth Rates (AGR) and/or the Relative Growth Rates (RGR). The observed and smoothed 
values are supplied in long format i.e. with the values for each set of smoothing parameters  
stacked one under the other in the supplied smooths.frame. Such data can be 
generated using probeSmooths.
Multiple plots, possibly each having multiple facets, are produced using ggplot2. 
The layout of these plots is controlled via the arguments plots.by, 
facet.x and facet.y. The basic principle is that the number of levels 
combinations of the smoothing-parameter factors Type, TunePar, 
TuneVal, Tuning (the combination of (TunePar and TuneVal), and 
Method that are included  in plots.by, facet.x and facet.y 
must be the same as those covered by the combinations of the values incorporated 
into the smooths.frame input to plotSmoothsDevnBoxplots via the 
data argument. This ensures that smooths from different parameter sets are not 
pooled into the same plot. The factors other than the smoothing-parameter 
factors can be supplied to the plots.by and facet arguments.
Usage
plotSmoothsDevnBoxplots(data, response, response.smoothed = NULL, 
                        individuals = "Snapshot.ID.Tag", times = "DAP", 
                        trait.types = c("response", "AGR", "RGR"), 
                        which.plots =  "absolute.boxplots", 
                        x.title = NULL, y.titles = NULL, 
                        devnboxes.plot.args = 
                          args4devnboxes_plot(plots.by = NULL, 
                                              facet.x = ".", facet.y = "."),
                        printPlot = TRUE, ...)
Arguments
| data | A  | 
| response | A  | 
| response.smoothed | A  | 
| times | A  | 
| individuals | A  | 
| trait.types | A  | 
| which.plots | A  | 
| x.title | Title for the x-axis, used for all plots. If  | 
| y.titles | A  | 
| devnboxes.plot.args | A named  | 
| printPlot | A  | 
| ... | allows passing of arguments to  | 
Value
A multilevel list that contains the ggplot 
objects for the plots produced. The first-level list 
has a component for each trait.types and each of these is a 
second-level list with contains the deviations boxplots 
for a response. Each plot is in an object of class 
ggplot, which can be plotted using print. 
Author(s)
Chris Brien
See Also
traitSmooth, probeSmooths, args4profile_plot, plotDeviationsBoxes, plotSmoothsMedianDevns, ggplot.
Examples
data(exampleData)
traits <- probeSmooths(data = longi.dat, 
                       response = "PSA", response.smoothed = "sPSA", 
                       times = "DAP", 
                       #only df is changed from the probeSmooth default
                       smoothing.args = 
                         args4smoothing(smoothing.methods = "direct", 
                                        spline.types = "NCSS", 
                                        df = c(4,7), lambdas = NULL), 
                       which.plots = "none")
plotSmoothsDevnBoxplots(data = traits, 
                        response = "PSA", response.smoothed = "sPSA", 
                        times = "DAP", x.title = "DAP",
                        #only facet.x is changed from the probeSmooth default
                        devnboxes.plot.args = 
                          args4devnboxes_plot(plots.by = NULL, 
                                              facet.x = "Tuning", facet.y = "."))