| plotMedianDeviations {growthPheno} | R Documentation |
Calculates and plots the median of the deviations of the smoothed values from the observed values.
Description
Calculates and plots the median of the deviations of the supplied smoothed values from the
supplied observed values for traits and combinations of different smoothing methods and
smoothing degrees of freedom, possibly for subsets of factor combinations.
The requisite values can be generated using probeSmoothing with which.plots
set to none. The results of smoothing methods applied externally to
growthPheno can be included via the extra.smooths argument. Envelopes of the
median value of a trait for each factor combination can be added.
Note: this function is soft deprecated and may be removed in
future versions.
Use plotSmoothsMedianDevns.
Usage
plotMedianDeviations(data, response, response.smoothed,
x = NULL, xname="xDays",
individuals = "Snapshot.ID.Tag",
x.title = NULL, y.titles = NULL,
facet.x = "Treatment.1", facet.y = "Smarthouse",
labeller = NULL,
trait.types = c("response", "AGR", "RGR"),
propn.types = c(0.1, 0.5, 0.75), propn.note = TRUE,
alpha.med.devn = 0.5,
smoothing.methods = "direct", df, extra.smooths = NULL,
ggplotFuncsMedDevn = NULL, printPlot = TRUE, ...)
Arguments
data |
A |
. The naming of the
columns for smoothed traits should follow the convention that a name is
made up, in the order sepcified, of (i) a response.smoothed,
(ii) the trait.type if not just a response trait type, a
smoothing.method or an extra.smooths and,
(iii) if a smoothing.method, a df.
Each component should be separated by a period (.).
response |
A |
response.smoothed |
A |
x |
A |
xname |
A |
individuals |
A |
x.title |
A |
y.titles |
A |
facet.x |
A |
facet.y |
A |
labeller |
A |
trait.types |
A |
propn.types |
A |
propn.note |
A |
alpha.med.devn |
A |
smoothing.methods |
A |
df |
A |
extra.smooths |
A |
ggplotFuncsMedDevn |
A |
printPlot |
A |
... |
allows passing of arguments to |
Value
A list that consists of two components: (i) a componenent named
plots that stores a list of the median deviations plots,
one for each trait.types; (ii) a component named med.dev.dat that stores the
data.frame containing the median deviations that have been plotted.
Each plot in the plots list is in an object of class
"ggplot", which can be plotted using print.
Author(s)
Chris Brien
See Also
plotDeviationsBoxes, probeSmoothing, ggplot.
Examples
data(exampleData)
vline <- list(ggplot2::geom_vline(xintercept=29, linetype="longdash", size=1),
ggplot2::scale_x_continuous(breaks=seq(28, 42, by=2)))
traits <- probeSmoothing(data = longi.dat, xname = "xDAP", times.factor = "DAP",
response = "PSA", response.smoothed = "sPSA",
df = c(4:7),
facet.x = ".", facet.y = ".",
which.plots = "none",
propn.types = NULL)
med <- plotMedianDeviations(data = traits,
response = "PSA", response.smoothed = "sPSA",
x="xDAP", xname = "xDAP",
df = c(4,7), x.title = "DAP",
facet.x = ".", facet.y = ".",
trait.types = "response", propn.types = 0.05,
ggplotFuncsMedDevn = vline)