Learn R Programming

cystiSim (version 0.1.0)

cystiSim: 'cystiSim' object

Description

Functions to initiate and explore 'cystiSim' objects. A 'cystiSim' object corresponds to multiple runs of a cystiSim model.

Usage

cystiSim(n = 100, mod, main = NULL)
report(x, ...)
"print"(x, ...)
"summary"(object, round = 3, ...)
"plot"(x, y, annotate = TRUE, ...)
"report"(x, name = "cystiSim", ...)
"elim"(x, show = c("m", "y"), ...)

Arguments

n
Number of iterations (months).
mod
cystiSim model.
main
cystiSim model label.
x
Object of class 'cystiSim'.
object
Object of class 'cystiSim'.
y
Currently ignored.
round
Number of decimal digits to be printed.
annotate
Should plot be annotated with summary information?
name
Report name.
show
Show time till elimination in terms of months or years?
...
Other arguments to be passed to generics.

Value

cystiSim returns an object of S3 class 'cystiSim'.

See Also

cystiRun

Examples

Run this code
## Not run: 
# 
# ## we will use the built-in Mbeya dataset
# prevalence(pig_mbeya$cysti)
# prevalence(man_mbeya$taenia)
# 
# ## define transmission probabilities
# ph2m <- 0.000174918
# pl2m <- 0.000149501
# m2p  <- 6.85E-05
# e2p  <- 0.00022611
# 
# ## set seed for reproducibility
# set.seed(264)
# 
# ## need to define coverage and efficacy of all interventions
# cov_man_mda <- 0.80
# cov_pig_mda <- 0.90
# cov_pig_vac <- NULL
# eff_man_mda <- 0.70
# eff_pig_mda <- 0.90
# eff_pig_vac <- NULL
# 
# ## run the simulations
# sim <-
# cystiSim(
#   n = 10,
#   main = "example",
#   mod = {
# initiate(man_mbeya, pig_mbeya, ph2m, pl2m, m2p, e2p) %>%
#   update(240) %>%
#   do_man_mda(coverage = cov_man_mda, efficacy = eff_man_mda) %>%
#   do_pig_mda(coverage = cov_pig_mda, efficacy = eff_pig_mda) %>%
#   update(120)
#   }
# )
# 
# ## summarize results
# summary(sim)
# 
# ## plot simulations (mean and uncertainty interval)
# plot(sim)
# 
# ## create PDF report and plot
# report(sim)
# ## End(Not run)

Run the code above in your browser using DataLab