generate time profile plots
plotTimeProfile.RdProduces time profiles for simulated and observed data.
For the simulated data a geom_line and a geom_ribbon layer are added
For the observed data a geom_point and a geom_errorbar layer are added
For more details and examples see the vignettes:
vignette("Time Profile Plots", package = "ospsuite.plots")vignette("ospsuite.plots", package = "ospsuite.plots")
Usage
plotTimeProfile(
data = NULL,
mapping = NULL,
observedData = NULL,
observedMapping = mapping,
metaData = NULL,
mapSimulatedAndObserved = NULL,
xscale = AxisScales$linear,
xscale.args = list(limits = c(0, NA)),
yscale = AxisScales$linear,
yscale.args = list(),
y2scale = AxisScales$linear,
y2scale.args = list(),
plotObject = NULL,
geomLineAttributes = getDefaultGeomAttributes("Line"),
geomRibbonAttributes = getDefaultGeomAttributes("Ribbon"),
geomPointAttributes = getDefaultGeomAttributes("Point"),
geomErrorbarAttributes = getDefaultGeomAttributes("Errorbar"),
geomLLOQAttributes = getDefaultGeomAttributes("LLOQ"),
groupAesthetics = c("colour", "fill", "shape")
)Arguments
- data
data.frame with simulated data will be displayed as lines with ribbons
- mapping
a list of aesthetic mappings to use for plot, additional to
{ggplot2}aesthetics, the aestheticsgroupby,error,error_relative,lloq,mdv,y2axisare available, see vignettes for more details and examples- observedData
data.frame with observed data will be displayed as points with error-bars
- observedMapping
a list of aesthetic mappings to use for observed data, per default is is set to mapping. So if both data sets have the same mapping, use only
mapping, if a different mapping is necessary usemappingandobservedMapping- metaData
A named list of information about
datasuch as thedimensionandunitof its variables.- mapSimulatedAndObserved
table with columns observed and simulated which maps simulated and observed data use of
mapSimulatedAndObservedtriggers reset of aesthetic scales after simulation layers- 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()- y2scale
either 'linear' the secondary axis is displayed linear, or 'log' secondary axis is displayed with log scale
- y2scale.args
list of arguments passed to
ggplot2::sec_axis(), trans, break are set by code- plotObject
An optional
ggplotobject on which to add the plot layers- geomLineAttributes
A
listwith arguments which are passed on to the callggplot2::geom_line- geomRibbonAttributes
A
listwith arguments which are passed on to the callggplot2::geom_ribbon- 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- geomLLOQAttributes
A
listwith arguments which are passed on to the callggplot2::geom_hline- groupAesthetics
vector of aesthetics, which are used for columns mapped with
groupby,
See also
Other plot functions:
plotBoxWhisker(),
plotForest(),
plotHistogram(),
plotPredVsObs(),
plotQQ(),
plotRangeDistribution(),
plotRatioVsCov(),
plotResVsCov(),
plotYVsX()
Examples
if (FALSE) { # \dontrun{
# Basic time profile plot with simulated data
plotTimeProfile(
data = simulationData,
mapping = aes(x = time, y = concentration, color = compound)
)
# Time profile with both simulated and observed data
plotTimeProfile(
data = simulationData,
observedData = observedData,
mapping = aes(x = time, y = concentration, color = treatment),
observedMapping = aes(x = time, y = concentration, color = treatment)
)
# Time profile with secondary y-axis
plotTimeProfile(
data = myData,
mapping = aes(x = time, y = concentration, y2axis = fraction_unbound)
)
} # }