plotSmoothsDevnBoxplots | R Documentation |
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 (response
and 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 factor
s 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 factor
s other than the smoothing-parameter
factor
s can be supplied to the plots.by
and facet
arguments.
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, ...)
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 |
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
.
Chris Brien
traitSmooth
, probeSmooths
, args4profile_plot
, plotDeviationsBoxes
, plotSmoothsMedianDevns
, ggplot
.
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 = "."))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.