plotTraj | R Documentation |
This function use faceting to plot all trajectories in a data frame.
Convenient to see results of several simulations, or data. Also, if
data
is present, then an additional plot is displayed with data and
potentially observation generated.
plotTraj(
traj = NULL,
stateNames = NULL,
data = NULL,
timeColumn = "time",
linesData = FALSE,
summary = TRUE,
replicateColumn = "replicate",
nonExtinct = NULL,
alpha = 1,
plot = TRUE,
colour = "red",
initDate = NULL,
same = FALSE
)
traj |
data.frame, output of |
stateNames |
character vector. Names of the state variables to plot.
Names must match |
data |
data frame. Observation times and observed data. The time column
must be named as given by |
timeColumn |
character vector. The column in the data that indicates time |
linesData |
logical. If |
summary |
logical. If |
replicateColumn |
character Vector. The column in the data that
indicates the replicate (if multiple replicates are to be plotted, i.e. if
|
nonExtinct |
character vector. Names of the infected states which must
be non-zero so the epidemic is still ongoing. When the names of these
states are provided, the extinction probability is plotted by computing the
proportion of faded-out epidemics over time. An epidemic has faded-out
when all the infected states (whose names are provided) are equal to 0.
This is only relevant for stochastic models. In addition, if |
alpha |
transparency of the trajectories (between 0 and 1). |
plot |
if |
colour |
character vector. If a character, will use that colour to plot
trajectories. If "all", use all available colours. If |
initDate |
character. Date of the first point of the time series
(default to |
same |
logical (default: FALSE); if TRUE, trajectories will be plotted in the same panel. |
simulateModelReplicates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.