Produces boxplots of the deviations of the observed values from the smoothed values over values of x.
plotDeviationsBoxes(data, observed, smoothed, x.factor,
x.title = NULL, y.titles = NULL,
facet.x = ".", facet.y = ".",
facet.labeller = NULL,
facet.scales = "fixed",
angle.x = 0,
deviations.plots = "absolute",
ggplotFuncs = NULL, printPlot = TRUE, ...)
A list whose components are named absolute
and relative
; a
component will contain an object of class "ggplot
" when the plot has been
requested using the deviations.plots
argument and a NULL
otherwise.
The objects can be plotted using print
.
A data.frame
containing the observed and smoothed values
from which the deviations are to be computed.
A character
specifying the response variable for which the
observed values are supplied.
A character
specifying the smoothed response variable,
corresponding to observed
, for which values are supplied.
Title for the x-axis. If NULL
then set to x
.
A character
giving the titles for the y-axis,
one for each plot specified deviations.plots
.
A data.frame
giving the variable to be used to
form subsets to be plotted in separate columns of plots.
Use "."
if a split into columns is not wanted. For
which.plots
set to methodcompare
or dfcompare
facet.x.pf
is ignored.
A data.frame
giving the variable to be used to
form subsets to be plotted in separate rows of plots.
Use "."
if a split into columns is not wanted.
A ggplot
function
for labelling the
facets of a plot produced using the ggplot
function.
For more information see ggplot
.
A character
specifying whether the scales are shared
across all facets of a plot ("fixed"), or do they vary across rows (the
default, "free_x"), columns ("free_y"), or both rows and columns ("free")?
A numeric
between 0 and 360 that gives the angle of the
x-axis text to the x-axis. It can also be set by supplying, in
ggplotFuncs
, a theme
function from ggplot2
.
A character
specifying whether
absolute
and/or relative
deviations are to be plotted.
A list
, each element of which contains the
results of evaluating a ggplot
function.
It is created by calling the list
function with
a ggplot
function call for each element.
These functions are applied in creating the ggplot
object for plotting.
A logical
indicating whether or not to print the
plots.
allows passing of arguments to ggplot
.
Chris Brien
plotSmoothsMedianDevns
, probeSmooths
, ggplot
.
data(exampleData)
plotDeviationsBoxes(longi.dat, observed = "PSA", smoothed = "sPSA",
x.factor="DAP", facet.x.pf = ".", facet.y= ".", df =5)
Run the code above in your browser using DataLab