Skip to content

Commit 027ce99

Browse files
committed
Updating documentation
1 parent d9531a4 commit 027ce99

8 files changed

+45
-2
lines changed

R/functions-npi.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
#' @return Returns an object of class epiworld_model, where model is
1111
#' substituted with the model name.
1212
#' @examples
13+
#' model <- ModelSEIR("COVID-19", prevalence = 0.7, transmission_rate = 0.3,
14+
#' incubation_days = 6, recovery_rate = 0.15)
15+
#'
1316
#' npi_add_vaccine(model, preval = .8, susceptibility_reduction = .9,
14-
#' transmission_reduction = .5, recovery_enhancer = .5, death_reduction = .9)
17+
#' transmission_reduction = .5, recovery_enhancer = .5,
18+
#' death_reduction = .9)
1519
#' @export
1620
npi_add_vaccine <- function(
1721
model, preval,
@@ -47,6 +51,8 @@ npi_add_vaccine <- function(
4751
#' @return Returns an object of class epiworld_model, where model is
4852
#' substituted with the model name.
4953
#' @examples
54+
#' model <- ModelSEIR("COVID-19", prevalence = 0.7, transmission_rate = 0.3,
55+
#' incubation_days = 6, recovery_rate = 0.15)
5056
#' npi_add_masking(model, preval = .8)
5157
#' @export
5258
npi_add_masking <- function(model, preval) {
@@ -78,6 +84,8 @@ npi_add_masking <- function(model, preval) {
7884
#' @return Returns an object of class epiworld_model, where model is
7985
#' substituted with the model name.
8086
#' @examples
87+
#' model <- ModelSEIR("COVID-19", prevalence = 0.7, transmission_rate = 0.3,
88+
#' incubation_days = 6, recovery_rate = 0.15)
8189
#' npi_add_school_closure(model, preval = .8, day = 10)
8290
#' @export
8391
npi_add_school_closure <- function(model, preval, day) {

R/functions-server.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ pop_generator <- function(
5858
#' of 10000 will return a scale of 1, 100000 will return a scale of 1000,
5959
#' 1000000 will return a scale of 10000.
6060
#'
61+
#' @examples
62+
#' find_scale(x = 100000)
63+
#'
6164
#' @export
6265
find_scale <- function(x) {
6366
res <- 10^(floor(log10(x)) + 1 - 3)
@@ -74,6 +77,11 @@ find_scale <- function(x) {
7477
#'
7578
#' @return A plot displaying each state from the model over the course of the
7679
#' simulation
80+
#' @examples
81+
#' model <- ModelSEIR("COVID-19", prevalence = 0.7, transmission_rate = 0.3,
82+
#' incubation_days = 6, recovery_rate = 0.15)
83+
#' plot_epi(model, mark_max = "Infected")
84+
#'
7785
#' @export
7886
plot_epi <- function(model, mark_max) {
7987
# If the user didn't specify mark_max
@@ -224,6 +232,10 @@ plot_epi <- function(model, mark_max) {
224232
#'
225233
#' @return A plot displaying the reproductive number for the model over the
226234
#' course of the simulation
235+
#' @examples
236+
#' model <- ModelSEIR("COVID-19", prevalence = 0.7, transmission_rate = 0.3,
237+
#' incubation_days = 6, recovery_rate = 0.15)
238+
#' plot_reproductive_epi(model)
227239
#' @export
228240
plot_reproductive_epi <- function (model) {
229241

man/find_scale.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/npi_add_masking.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/npi_add_school_closure.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/npi_add_vaccine.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_epi.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_reproductive_epi.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)