Base Plot for Residuals and Predictions vs Covariates
plotYVsX.RdThis function creates a base plot for plotResVsCov(), plotRatioVsCov(), and plotPredVsObs().
For details and examples, see the vignettes:
vignette("Goodness of fit", package = "ospsuite.plots")vignette("ospsuite.plots", package = "ospsuite.plots")
Usage
plotYVsX(
data,
mapping,
metaData = NULL,
geomPointAttributes = getDefaultGeomAttributes("Point"),
geomErrorbarAttributes = getDefaultGeomAttributes("Errorbar"),
geomGuestLineAttributes = getDefaultGeomAttributes("GuestLine"),
geomComparisonLineAttributes = getDefaultGeomAttributes("ComparisonLine"),
geomLLOQAttributes = getDefaultGeomAttributes("LLOQ"),
groupAesthetics = c("colour", "fill", "shape"),
comparisonLineVector = NULL,
addRegression = FALSE,
addGuestLimits = FALSE,
deltaGuest = 1,
labelGuestCriteria = "guest criteria",
residualScale = NULL,
asSquarePlot = FALSE,
xscale = AxisScales$linear,
xscale.args = list(),
yscale = AxisScales$log,
yscale.args = list(),
observedDataDirection = "y",
yDisplayAsAbsolute = TRUE
)Arguments
- data
A
data.framecontaining the data to plot.- mapping
A list of aesthetic mappings to use for the plot.
- metaData
A named list of information about
datasuch as thedimensionandunitof its variables.- geomPointAttributes
A
listwith arguments which are passed on to the callggplot2::geom_point- geomErrorbarAttributes
A
listwith arguments which are passed on to the callggplot2::geom_errorbar- geomGuestLineAttributes
A
listof arguments passed toggplot2::geom_functionto display guest criteria.- geomComparisonLineAttributes
A
listof arguments passed toggplot2::hlineorggplot2::ablineto display comparison lines.- geomLLOQAttributes
A
listwith arguments which are passed on to the callggplot2::geom_hline- groupAesthetics
A character vector of aesthetic names used for grouping data points when calculating comparison statistics. Data will be grouped by combinations of these aesthetics before computing counts and proportions within comparison lines. Common grouping aesthetics include
"colour","fill","shape".- comparisonLineVector
A vector defining the comparison lines.
- addRegression
A boolean that activates the insertion of a regression line.
- addGuestLimits
A boolean that activates the insertion of guest limits.
- deltaGuest
Numeric value parameter for the Guest function.
- labelGuestCriteria
Label used in the legend for guest criteria (default: "guest criteria").
- residualScale
Either "linear", "log", or "ratio" scale for residuals.
- asSquarePlot
A boolean; if true, the plot is returned as a square plot with aspect ratio = 1 and fixed ratios.
- xscale
either 'linear' then
ggplot2::scale_x_continuous()or 'log' thenggplot2::scale_x_log10()is used- xscale.args
list of arguments passed to
ggplot2::scale_x_continuous()orggplot2::scale_x_log10()- yscale
either 'linear' then
ggplot2::scale_y_continuous()or 'log' thenggplot2::scale_y_log10()is used- yscale.args
list of arguments passed to
ggplot2::scale_y_continuous()orggplot2::scale_y_log10()- observedDataDirection
Either 'x' or 'y', defining the direction of observed data.
- yDisplayAsAbsolute
A boolean that defines the direction of comparison lines.
See also
Other plot functions:
plotBoxWhisker(),
plotForest(),
plotHistogram(),
plotPredVsObs(),
plotQQ(),
plotRangeDistribution(),
plotRatioVsCov(),
plotResVsCov(),
plotTimeProfile()