plot_single_path: Show infection counts (cumulative and ongoing) for a single...

Description Usage Arguments Value

View source: R/plotting-functions.R

Description

Show infection counts (cumulative and ongoing) for a single path

Usage

1
2
3
4
5
6
7
plot_single_path(
  path_data,
  tlim = NA,
  ylim = NA,
  scale = "log",
  smooth_data = NULL
)

Arguments

path_data

A data.frame, with at least the columns time, n_infected, and n_infectious

tlim

Upper time limit to display. If NA, show the entire path.

ylim

Explicit limit for the top of the graph. Useful when showing the detail of one path in comparison with the output of plot_paths, so that the y-scales are the same between the two plots.

scale

If equal to "log", show in log scale (default). If any other value, show in linear scale. Like argument ylim, this is useful when comparing to the output of plot_paths.

smooth_data

A data.frame, with at least the columns time, n_infected, and n_infectious. If given, will be superposed on top of the paths plot.

Value

A ggplot plot showing the cumulative infection count, the ongoing infection count, and, if smooth_data is given, the expectation values of the stochastic process.


pspc-data-science/branchsim documentation built on Jan. 19, 2021, 10:10 a.m.