Skip to content

Commit

Permalink
Adding cross-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed May 8, 2024
1 parent 9b36461 commit d91ec09
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
13 changes: 7 additions & 6 deletions R/functions-npi.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#' @param death_reduction Reduction in death probability due to vaccine.
#' @return Returns an object of class epiworld_model, where model is
#' substituted with the model name.

#' @examples
#' library(epiworldR) # for ModelSEIRCONN function
#' model <- ModelSEIRCONN("COVID-19", n = 1000, prevalence = 0.05,
Expand All @@ -20,6 +19,7 @@
#' transmission_reduction = .5, recovery_enhancer = .5,
#' death_reduction = .9)
#' @export
#' @family npis
npi_add_vaccine <- function(
model, preval,
susceptibility_reduction = .9,
Expand Down Expand Up @@ -53,7 +53,6 @@ npi_add_vaccine <- function(
#' @param preval Prevalence of masking within the population.
#' @return Returns an object of class epiworld_model, where model is
#' substituted with the model name.

#' @examples
#' library(epiworldR) # for ModelSEIRCONN function
#' model <- ModelSEIRCONN("COVID-19", n = 1000, prevalence = 0.05,
Expand All @@ -62,6 +61,7 @@ npi_add_vaccine <- function(
#' run(model, ndays = 100, seed = 123)
#' npi_add_masking(model, preval = .8)
#' @export
#' @family npis
npi_add_masking <- function(model, preval) {

if (preval > 0) {
Expand All @@ -88,9 +88,9 @@ npi_add_masking <- function(model, preval) {
#' @param model epiworldR model.
#' @param preval Prevalence of school closure within the population.
#' @param day Day in the simulation where school closure goes into effect.
#' @param reduction Reduction in transmission probability due to school closure.
#' @return Returns an object of class epiworld_model, where model is
#' substituted with the model name.

#' @examples
#' library(epiworldR) # for ModelSEIRCONN function
#' model <- ModelSEIRCONN("COVID-19", n = 1000, prevalence = 0.05,
Expand All @@ -99,15 +99,16 @@ npi_add_masking <- function(model, preval) {
#' run(model, ndays = 100, seed = 123)
#' npi_add_school_closure(model, preval = .8, day = 10)
#' @export
npi_add_school_closure <- function(model, preval, day) {
#' @family npis
npi_add_school_closure <- function(model, preval, day, reduction = 0.9) {

if (preval > 0) {

# Creating a tool
tool_ <- epiworldR::tool(
name = "School Closure",
susceptibility_reduction = 0,
transmission_reduction = 0.90,
transmission_reduction = reduction,
recovery_enhancer = 0,
death_reduction = 0
)
Expand All @@ -134,7 +135,7 @@ npi_add_school_closure <- function(model, preval, day) {
#' @param input User epiworldR model selection.
#' @returns Returns an object of class epiworld_model, where model is
#' substituted with the model name.

#' @family npis
#' @export
npi_add_all <- function(model, modelname, input) {

Expand Down
7 changes: 7 additions & 0 deletions man/npi_add_all.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/npi_add_masking.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion man/npi_add_school_closure.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/npi_add_vaccine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d91ec09

Please sign in to comment.