Learn R Programming

epiworldR (version 0.12.0.0)

epiworld-repnum: Reproductive number (Rt)

Description

Extraction and plotting of the reproductive number (Rt) by virus over time.

Usage

get_reproductive_number(x)

# S3 method for epiworld_repnum plot( x, y = NULL, ylab = "Average Rep. Number", xlab = "Day (step)", main = "Reproductive Number", type = "b", plot = TRUE, ... )

plot_reproductive_number(x, ...)

Value

  • The get_reproductive_number function returns an object of class epiworld_repnum.

  • The plot method for epiworld_repnum returns a plot of the reproductive number over time.

Arguments

x

An object of class epiworld_sir, epiworld_seir, etc. (any model), or an object of class epiworld_repnum.

y

Ignored.

ylab, xlab, main, type

Further parameters passed to graphics::plot()

plot

Logical scalar. If TRUE (default), the function will plot the desired statistic.

...

In the case of plot methods, further arguments passed to graphics::plot.

Details

The plot_reproductive_number function is a wrapper around get_reproductive_number that plots the result.

See Also

Other Epidemiological metrics: epiworld-gentime

Examples

Run this code
# SEIR Connected model
seirconn <- ModelSEIRCONN(
  name              = "Disease",
  n                 = 10000,
  prevalence        = 0.1,
  contact_rate      = 2.0,
  transmission_rate = 0.8,
  incubation_days   = 7.0,
  recovery_rate     = 0.3
)

set.seed(937)
run(seirconn, 50)

# Retrieving (and plotting) the reproductive number
rp <- get_reproductive_number(seirconn)
plot(rp) # Also equivalent to plot_reproductive_number(seirconn)

Run the code above in your browser using DataLab