Skip to contents

Produces 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 aesthetics groupby,error,error_relative,lloq, mdv, y2axis are 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 use mapping and observedMapping

metaData

A named list of information about data such as the dimension and unit of its variables.

mapSimulatedAndObserved

table with columns observed and simulated which maps simulated and observed data use of mapSimulatedAndObserved triggers reset of aesthetic scales after simulation layers

xscale

either 'linear' then ggplot2::scale_x_continuous() or 'log' then ggplot2::scale_x_log10() is used

xscale.args

list of arguments passed to ggplot2::scale_x_continuous() or ggplot2::scale_x_log10()

yscale

either 'linear' then ggplot2::scale_y_continuous() or 'log' then ggplot2::scale_y_log10() is used

yscale.args

list of arguments passed to ggplot2::scale_y_continuous() or ggplot2::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 ggplot object on which to add the plot layers

geomLineAttributes

A list with arguments which are passed on to the call ggplot2::geom_line

geomRibbonAttributes

A list with arguments which are passed on to the call ggplot2::geom_ribbon

geomPointAttributes

A list with arguments which are passed on to the call ggplot2::geom_point

geomErrorbarAttributes

A list with arguments which are passed on to the call ggplot2::geom_errorbar

geomLLOQAttributes

A list with arguments which are passed on to the call ggplot2::geom_hline

groupAesthetics

vector of aesthetics, which are used for columns mapped with groupby,

Value

A ggplot object

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)
)
} # }