plotTimes: Plot at different times

View source: R/multSimData_outputMethods.R

plotTimesR Documentation

Plot at different times

Description

Plot a boxplot or violin plot or dotplot for every time value in the data.frame (a maximum of 12 different time values is allowed). Outliers can be plotted with a number on their side which represents the seed number that was #' used to simulate the simulation that causes the outlier. The number of outliers that shall be plotted this way is determined by parameter nolo(= number of labelled outliers). A red diamond represents the median of the simulated values. The plot is created with ggplot2 and can be modified afterwards.

Usage

plotTimes(x, vars, times, nolo = 0, plottype = "boxplot", ...)

## S3 method for class 'multSimData'
plotTimes(x, vars, times, nolo = 0, plottype = "boxplot", ...)

## S3 method for class 'multSim'
plotTimes(x, vars, times, nolo = 0, plottype = "boxplot", ...)

Arguments

x

object of class multSim or multSimData.

vars

character vector of variable names that shall be plotted

times

numeric vector with time values to plot. If no vector is given, ten values between the minimum and maximum provided time values will be plotted.

nolo

an integer giving the number of outliers that shall be labelled with the seed number that was used for simulation. Defaults to 0.

plottype

character vector determining the type of the plot. Possible values are 'boxplot', 'violin' or 'dotplot'. Defaults to 'boxplot'.

...

additional parameters for the plotting function (either geom_boxplot, geom_violin or geom_dotplot, depending on parameter plottype).

Examples

data("simplePdmp")
times(simplePdmp) <- c(from = 0, to = 5, by = 1)
md <- getMultSimData(multSim(simplePdmp, 1:8), times = 1:5)
plotTimes(md, plottype = 'violin')
plotTimes(md, nolo = 3)

CharlotteJana/pdmpsim documentation built on Oct. 21, 2024, 4:54 p.m.