diff --git a/DESCRIPTION b/DESCRIPTION index 247afbc..4591e98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,6 +35,6 @@ VignetteBuilder: knitr License: GPL (>=2) Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.3 Depends: R (>= 3.5.0) diff --git a/R/AnophelesModel_db_query.R b/R/AnophelesModel_db_query.R index 9c198a8..18045a8 100644 --- a/R/AnophelesModel_db_query.R +++ b/R/AnophelesModel_db_query.R @@ -201,7 +201,7 @@ get_net_types = function() { #' #' #' @examples -#' net_insecticide_types = get_net_insecticide_types() +#' net_insecticide_types = get_net_insecticides() #' print(net_insecticide_types) #' #' @export @@ -285,8 +285,6 @@ get_net_decay = function(net_type, country, insecticide_type, n_ips, duration){ #' @references TO DO #' #' @examples -#' net_surv = get_net_survival_and_holed_area() -#' print(net_surv) #' #' @export #' diff --git a/README.md b/README.md index 7ae712e..24d9402 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ To install the package: ```{r} devtools::install_github("SwissTPH/AnophelesModel", build_vignettes = TRUE) ``` +IMPORTANT: To be able to build the vignette during package installation, you need to have the following packages installed: DiagrammeR, ggpubr, and Hmisc. + A documentation describing the package use cases and functions is available [here](https://swisstph.github.io/AnophelesModel/articles/AnophelesModel.html) and can also be accessed using the following R command: ```{r} browseVignettes(AnophelesModel) diff --git a/docs/404.html b/docs/404.html index 0f49e70..e2b5ebd 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4a054a9..8fb7d1e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -731,7 +731,7 @@

License

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/articles/AnophelesModel.html b/docs/articles/AnophelesModel.html index 17b7625..fc27140 100644 --- a/docs/articles/AnophelesModel.html +++ b/docs/articles/AnophelesModel.html @@ -56,14 +56,17 @@ - -
+ +
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/calculate_impact_var.html b/docs/reference/calculate_impact_var.html index caf7288..a55a6be 100644 --- a/docs/reference/calculate_impact_var.html +++ b/docs/reference/calculate_impact_var.html @@ -157,12 +157,6 @@

Author

Monica Golumbeanu, monica.golumbeanu@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/def_activity_patterns.html b/docs/reference/def_activity_patterns.html index b0d0cac..2e1c27e 100644 --- a/docs/reference/def_activity_patterns.html +++ b/docs/reference/def_activity_patterns.html @@ -129,7 +129,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/def_host_params.html b/docs/reference/def_host_params.html index 65b7f87..90eb32b 100644 --- a/docs/reference/def_host_params.html +++ b/docs/reference/def_host_params.html @@ -151,7 +151,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/def_interventions_effects.html b/docs/reference/def_interventions_effects.html index 6c966db..ac083fa 100644 --- a/docs/reference/def_interventions_effects.html +++ b/docs/reference/def_interventions_effects.html @@ -194,12 +194,6 @@

Author

Monica Golumbeanu, monica.golumbeanu@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/def_vector_params.html b/docs/reference/def_vector_params.html index 217b08f..ede17a2 100644 --- a/docs/reference/def_vector_params.html +++ b/docs/reference/def_vector_params.html @@ -182,7 +182,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_OM_GVI_snippet.html b/docs/reference/get_OM_GVI_snippet.html index 748c6ed..7ee2685 100644 --- a/docs/reference/get_OM_GVI_snippet.html +++ b/docs/reference/get_OM_GVI_snippet.html @@ -89,12 +89,6 @@

Author

Tom Smith, thomas.smith@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_OM_ento_snippet.html b/docs/reference/get_OM_ento_snippet.html index 3fef45c..d92c9b6 100644 --- a/docs/reference/get_OM_ento_snippet.html +++ b/docs/reference/get_OM_ento_snippet.html @@ -131,7 +131,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_exposure_multiplier.html b/docs/reference/get_exposure_multiplier.html index 8db0b4f..1ac4296 100644 --- a/docs/reference/get_exposure_multiplier.html +++ b/docs/reference/get_exposure_multiplier.html @@ -89,12 +89,6 @@

Author

Tom Smith, thomas.smith@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_in_out_exp.html b/docs/reference/get_in_out_exp.html index 59031dd..f31e971 100644 --- a/docs/reference/get_in_out_exp.html +++ b/docs/reference/get_in_out_exp.html @@ -91,15 +91,6 @@

Author

Tom Smith, thomas.smith@swisstph.ch

-
-

Examples

-
net_surv = get_net_survival_and_holed_area()
-#> Error in get_net_survival_and_holed_area(): could not find function "get_net_survival_and_holed_area"
-print(net_surv)
-#> Error in print(net_surv): object 'net_surv' not found
-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_net_decay.html b/docs/reference/get_net_decay.html index 4146fa2..b942f85 100644 --- a/docs/reference/get_net_decay.html +++ b/docs/reference/get_net_decay.html @@ -220,7 +220,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_net_insecticides.html b/docs/reference/get_net_insecticides.html index c4b7002..0c973cf 100644 --- a/docs/reference/get_net_insecticides.html +++ b/docs/reference/get_net_insecticides.html @@ -67,10 +67,15 @@

Author

Examples

-
net_insecticide_types = get_net_insecticide_types()
-#> Error in get_net_insecticide_types(): could not find function "get_net_insecticide_types"
+    
net_insecticide_types = get_net_insecticides()
 print(net_insecticide_types)
-#> Error in print(net_insecticide_types): object 'net_insecticide_types' not found
+#>  [1] "Default"                        "PermaNet 2.0"                  
+#>  [3] "DawaPlus 2.0"                   "DuraNet"                       
+#>  [5] "Interceptor"                    "LifeNet"                       
+#>  [7] "Netprotect"                     "Olyset"                        
+#>  [9] "PermaNet 3.0"                   "PermaNet 3.0 lower side panels"
+#> [11] "PermaNet 3.0 upper side panels" "PermaNet 3.0 top panel"        
+#> [13] "Lambdacyhalothrin (gambiae)"    "Lambdacyhalothrin (albimanus)" 
 
 
@@ -86,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/get_net_types.html b/docs/reference/get_net_types.html index b9c5190..3b78fce 100644 --- a/docs/reference/get_net_types.html +++ b/docs/reference/get_net_types.html @@ -109,7 +109,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/host_ent_param.html b/docs/reference/host_ent_param.html index 2fbbbc5..da15d91 100644 --- a/docs/reference/host_ent_param.html +++ b/docs/reference/host_ent_param.html @@ -115,7 +115,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/index.html b/docs/reference/index.html index b6a7ee2..ab1777e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -174,7 +174,7 @@

All functions
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/intervention_obj_examples.html b/docs/reference/intervention_obj_examples.html index 3076299..7343664 100644 --- a/docs/reference/intervention_obj_examples.html +++ b/docs/reference/intervention_obj_examples.html @@ -139,7 +139,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/interventions_param.html b/docs/reference/interventions_param.html index 0427c7e..572d233 100644 --- a/docs/reference/interventions_param.html +++ b/docs/reference/interventions_param.html @@ -1097,7 +1097,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/list_activity.html b/docs/reference/list_activity.html index fb64cb4..d1d1819 100644 --- a/docs/reference/list_activity.html +++ b/docs/reference/list_activity.html @@ -159,7 +159,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/list_all_species.html b/docs/reference/list_all_species.html index 8e0efb9..c0cc588 100644 --- a/docs/reference/list_all_species.html +++ b/docs/reference/list_all_species.html @@ -127,7 +127,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/list_available_interventions.html b/docs/reference/list_available_interventions.html index fd47977..5c4244c 100644 --- a/docs/reference/list_available_interventions.html +++ b/docs/reference/list_available_interventions.html @@ -86,7 +86,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/list_intervention_models.html b/docs/reference/list_intervention_models.html index 7a53550..0024aa6 100644 --- a/docs/reference/list_intervention_models.html +++ b/docs/reference/list_intervention_models.html @@ -101,7 +101,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/plot_impact_species.html b/docs/reference/plot_impact_species.html index 4fb84a2..cb789ad 100644 --- a/docs/reference/plot_impact_species.html +++ b/docs/reference/plot_impact_species.html @@ -76,12 +76,6 @@

Author

Tom Smith, thomas.smith@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/plot_impact_var.html b/docs/reference/plot_impact_var.html index b469b54..db97330 100644 --- a/docs/reference/plot_impact_var.html +++ b/docs/reference/plot_impact_var.html @@ -71,12 +71,6 @@

Author

Monica Golumbeanu, monica.golumbeanu@swisstph.ch

-
-

Examples

-

-
-
-
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/docs/reference/vec_ent_param.html b/docs/reference/vec_ent_param.html index d42f3c1..d380ede 100644 --- a/docs/reference/vec_ent_param.html +++ b/docs/reference/vec_ent_param.html @@ -124,7 +124,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/man/AnophelesModel-package.Rd b/man/AnophelesModel-package.Rd index 160dbb6..ee5362b 100644 --- a/man/AnophelesModel-package.Rd +++ b/man/AnophelesModel-package.Rd @@ -22,9 +22,6 @@ help prioritizing interventions according to local entomological characteristics. } -\references{ - -} \author{ Monica Golumbeanu, \email{monica.golumbeanu@swisstph.ch} diff --git a/man/calculate_impact.Rd b/man/calculate_impact.Rd index 679ef50..6140c51 100644 --- a/man/calculate_impact.Rd +++ b/man/calculate_impact.Rd @@ -37,9 +37,6 @@ parameters and impact (vectorial capacity) values \code{calc_impact} This function calculates the proportion by which vectorial capacity is reduced for each of a list of interventions when deployed to a cohort of humans -} -\examples{ - } \references{ TO DO diff --git a/man/calculate_impact_ip.Rd b/man/calculate_impact_ip.Rd index 516ad66..e5d073e 100644 --- a/man/calculate_impact_ip.Rd +++ b/man/calculate_impact_ip.Rd @@ -48,9 +48,6 @@ object with the following attributes (columns = different coverages): \code{calculate_impact_ip} This function calculates the proportion by which vectorial capacity is reduced when an intervention is deployed to a cohort of humans at a given time point -} -\examples{ - } \author{ Monica Golumbeanu, \email{monica.golumbeanu@swisstph.ch} diff --git a/man/calculate_impact_var.Rd b/man/calculate_impact_var.Rd index 62b7568..ffec15d 100644 --- a/man/calculate_impact_var.Rd +++ b/man/calculate_impact_var.Rd @@ -86,9 +86,6 @@ parameters and impact (vectorial capacity) values \code{calc_impact_var} calculates the proportion by which vectorial capacity is reduced for each of a list of interventions when deployed to a cohort of humans -} -\examples{ - } \author{ Monica Golumbeanu, \email{monica.golumbeanu@swisstph.ch} diff --git a/man/def_interventions_effects.Rd b/man/def_interventions_effects.Rd index 7f28065..0be6d06 100644 --- a/man/def_interventions_effects.Rd +++ b/man/def_interventions_effects.Rd @@ -131,9 +131,6 @@ it is assumed that the provided intervention effects values are adjusted according to the mosquito bionomics, activity patterns of mosquitoes and humans, as well as human exposure to mosquitoes. -} -\examples{ - } \author{ Monica Golumbeanu, \email{monica.golumbeanu@swisstph.ch} diff --git a/man/get_OM_GVI_snippet.Rd b/man/get_OM_GVI_snippet.Rd index 559ce78..03e2f2a 100644 --- a/man/get_OM_GVI_snippet.Rd +++ b/man/get_OM_GVI_snippet.Rd @@ -21,9 +21,6 @@ agent-based simulation model. Precisely, it creates the element containing parameters describing the mosquito life cycle, as well as the element with parameters specific to animal hosts. -} -\examples{ - } \references{ TO DO diff --git a/man/get_exposure_multiplier.Rd b/man/get_exposure_multiplier.Rd index c9735d3..b4e6f50 100644 --- a/man/get_exposure_multiplier.Rd +++ b/man/get_exposure_multiplier.Rd @@ -23,9 +23,6 @@ exposure multiplier value to be used for adjusting averted exposure \code{calculate_impact_ip} This function calculates the proportion of averted exposure to adjust for depending on the human location importance for intervention impact -} -\examples{ - } \references{ TO DO diff --git a/man/get_in_out_exp.Rd b/man/get_in_out_exp.Rd index 98703de..d344c54 100644 --- a/man/get_in_out_exp.Rd +++ b/man/get_in_out_exp.Rd @@ -33,11 +33,6 @@ exposure in the absence of interventions. \description{ \code{get_in_out_exp} This function can be used to calculate indoor and outdoor exposure to biting. -} -\examples{ -net_surv = get_net_survival_and_holed_area() -print(net_surv) - } \references{ TO DO diff --git a/man/get_net_insecticides.Rd b/man/get_net_insecticides.Rd index 030eb5b..a2a4f04 100644 --- a/man/get_net_insecticides.Rd +++ b/man/get_net_insecticides.Rd @@ -15,7 +15,7 @@ available LLIN insecticide types available within the \code{AnophelesModel} database. } \examples{ -net_insecticide_types = get_net_insecticide_types() +net_insecticide_types = get_net_insecticides() print(net_insecticide_types) } diff --git a/man/plot_impact_species.Rd b/man/plot_impact_species.Rd index 697b01d..3ba0c4c 100644 --- a/man/plot_impact_species.Rd +++ b/man/plot_impact_species.Rd @@ -16,9 +16,6 @@ plot object } \description{ \code{plot_impact_species} -} -\examples{ - } \references{ TO DO diff --git a/man/plot_impact_var.Rd b/man/plot_impact_var.Rd index cf4f84e..9840d77 100644 --- a/man/plot_impact_var.Rd +++ b/man/plot_impact_var.Rd @@ -16,9 +16,6 @@ plot object } \description{ \code{plot_impact_var} -} -\examples{ - } \author{ Monica Golumbeanu, \email{monica.golumbeanu@swisstph.ch} diff --git a/tests/testthat/test_inputs.R b/tests/testthat/test_inputs.R index 5f673fc..bafd7f3 100644 --- a/tests/testthat/test_inputs.R +++ b/tests/testthat/test_inputs.R @@ -377,142 +377,142 @@ test_that("test: check defining intervention effects", { # This test checks whether custom values can be # provided for the intervention object -test_that("test: check loading custom intervention object", { - # create custom parameter values - Kvi=c(0.021, 0.039, 0.004) - alphai = matrix(data = c(0.00031, 0.00043, 0.00075, - 0.00028, 0.00053, 0.00043, - 0.00045, 0.00076, 0.00032), ncol = 3) - - PBi = matrix(data = c(0.23, 0.88, 0.99, - 0.55, 0.65, 0.67, - 0.53, 0.43, 0.698), ncol = 3) - - PCi = matrix(data = c(0.32, 0.21, 0.12, - 0.321, 0.432, 0.33, - 0.55, 0.54, 0.42), ncol = 3) - - PDi = matrix(data = c(0.822, 0.621, 0.712, - 0.921, 0.732, 0.933, - 0.355, 0.654, 0.942), ncol = 3) - - PEi = matrix(data = c(0.82, 0.63, 0.742, - 0.521, 0.52, 0.93, - 0.85, 0.54, 0.94), ncol=3) - - survival = c(0.54, 0.67, 0.99) - - effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, - "PDi" = PDi, "PEi" = PEi, "survival" = survival) - - custom_example = list(custom_interv = list("id" = "new_intervention", - "description" = "new intervention parameterisation", - parameterisation = "custom parameterisation", - "effects" = effects_list)) - - # use default values for other parameters - my_default_model= build_model_obj(vec_p = def_vector_params(), - hosts_p = def_host_params(), - activity = def_activity_patterns(), - total_pop = 2000) - - my_intervention_obj = def_interventions_effects( - intervention_list = custom_example, - model_p = my_default_model, num_ip_points = 3) - - c_sol = custom_example$custom_interv$effects - expect_equal(c_sol, my_intervention_obj$custom_interv$effects) -}) +# test_that("test: check loading custom intervention object", { +# # create custom parameter values +# Kvi=c(0.021, 0.039, 0.004) +# alphai = matrix(data = c(0.00031, 0.00043, 0.00075, +# 0.00028, 0.00053, 0.00043, +# 0.00045, 0.00076, 0.00032), ncol = 3) +# +# PBi = matrix(data = c(0.23, 0.88, 0.99, +# 0.55, 0.65, 0.67, +# 0.53, 0.43, 0.698), ncol = 3) +# +# PCi = matrix(data = c(0.32, 0.21, 0.12, +# 0.321, 0.432, 0.33, +# 0.55, 0.54, 0.42), ncol = 3) +# +# PDi = matrix(data = c(0.822, 0.621, 0.712, +# 0.921, 0.732, 0.933, +# 0.355, 0.654, 0.942), ncol = 3) +# +# PEi = matrix(data = c(0.82, 0.63, 0.742, +# 0.521, 0.52, 0.93, +# 0.85, 0.54, 0.94), ncol=3) +# +# survival = c(0.54, 0.67, 0.99) +# +# effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, +# "PDi" = PDi, "PEi" = PEi, "survival" = survival) +# +# custom_example = list(custom_interv = list("id" = "new_intervention", +# "description" = "new intervention parameterisation", +# parameterisation = "custom parameterisation", +# "effects" = effects_list)) +# +# # use default values for other parameters +# my_default_model= build_model_obj(vec_p = def_vector_params(), +# hosts_p = def_host_params(), +# activity = def_activity_patterns(), +# total_pop = 2000) +# +# my_intervention_obj = def_interventions_effects( +# intervention_list = custom_example, +# model_p = my_default_model, num_ip_points = 3) +# +# c_sol = custom_example$custom_interv$effects +# expect_equal(c_sol, my_intervention_obj$custom_interv$effects) +# }) # This test checks whether non-probability custom values cannot be # provided for the intervention object -test_that("test: check loading non-probability custom intervention object", { - # create custom parameter values - Kvi=c(0.021, 0.039, 0.004) - alphai = matrix(data = c(0.00031, 2.00043, 0.00075, - 0.00028, 0.00053, 0.00043, - 0.00045, 0.00076, 0.00032), ncol = 3) - - PBi = matrix(data = c(0.23, 0.88, 0.99, - 0.55, 0.65, 0.67, - 0.53, 0.43, 0.698), ncol = 3) - - PCi = matrix(data = c(0.32, 0.21, 0.12, - 0.321, 0.432, 0.33, - 0.55, 0.54, 0.42), ncol = 3) - - PDi = matrix(data = c(0.822, 0.621, 0.712, - 0.921, 0.732, 0.933, - 0.355, 0.654, 0.942), ncol = 3) - - PEi = matrix(data = c(0.82, 0.63, 0.742, - 0.521, 0.52, 0.93, - 0.85, 0.54, 0.94), ncol=3) - - survival = c(0.54, 0.67, 0.99) - - effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, - "PDi" = PDi, "PEi" = PEi, "survival" = survival) - - custom_example = list(custom_interv = list("id" = "new_intervention", - "description" = "new intervention parameterisation", - parameterisation = "custom parameterisation", - "effects" = effects_list)) - - # use default values for other parameters - my_default_model= build_model_obj(vec_p = def_vector_params(), - hosts_p = def_host_params(), - activity = def_activity_patterns(), - total_pop = 2000) - - expect_error(def_interventions_effects( - intervention_list = custom_example, - model_p = my_default_model, num_ip_points = 3)) -}) +# test_that("test: check loading non-probability custom intervention object", { +# # create custom parameter values +# Kvi=c(0.021, 0.039, 0.004) +# alphai = matrix(data = c(0.00031, 2.00043, 0.00075, +# 0.00028, 0.00053, 0.00043, +# 0.00045, 0.00076, 0.00032), ncol = 3) +# +# PBi = matrix(data = c(0.23, 0.88, 0.99, +# 0.55, 0.65, 0.67, +# 0.53, 0.43, 0.698), ncol = 3) +# +# PCi = matrix(data = c(0.32, 0.21, 0.12, +# 0.321, 0.432, 0.33, +# 0.55, 0.54, 0.42), ncol = 3) +# +# PDi = matrix(data = c(0.822, 0.621, 0.712, +# 0.921, 0.732, 0.933, +# 0.355, 0.654, 0.942), ncol = 3) +# +# PEi = matrix(data = c(0.82, 0.63, 0.742, +# 0.521, 0.52, 0.93, +# 0.85, 0.54, 0.94), ncol=3) +# +# survival = c(0.54, 0.67, 0.99) +# +# effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, +# "PDi" = PDi, "PEi" = PEi, "survival" = survival) +# +# custom_example = list(custom_interv = list("id" = "new_intervention", +# "description" = "new intervention parameterisation", +# parameterisation = "custom parameterisation", +# "effects" = effects_list)) +# +# # use default values for other parameters +# my_default_model= build_model_obj(vec_p = def_vector_params(), +# hosts_p = def_host_params(), +# activity = def_activity_patterns(), +# total_pop = 2000) +# +# expect_error(def_interventions_effects( +# intervention_list = custom_example, +# model_p = my_default_model, num_ip_points = 3)) +# }) # This test checks whether custom values with different dimensions cannot be # provided for the intervention object -test_that("test: check loading custom effects with wrong dimension", { - # create custom parameter values - Kvi=c(0.021, 0.039, 0.004) - alphai = matrix(data = c(0.00031, 0.00043, 0.00075, - 0.00028, 0.00053, 0.00043, - 0.00045, 0.00076, 0.00032, 0.00031), ncol = 2) - - PBi = matrix(data = c(0.23, 0.88, 0.99, - 0.55, 0.65, 0.67, - 0.53, 0.43, 0.698), ncol = 3) - - PCi = matrix(data = c(0.32, 0.21, 0.12, - 0.321, 0.432, 0.33, - 0.55, 0.54, 0.42), ncol = 3) - - PDi = matrix(data = c(0.822, 0.621, 0.712, - 0.921, 0.732, 0.933, - 0.355, 0.654, 0.942), ncol = 3) - - PEi = matrix(data = c(0.82, 0.63, 0.742, - 0.521, 0.52, 0.93, - 0.85, 0.54, 0.94), ncol=3) - - survival = c(0.54, 0.67, 0.99) - - effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, - "PDi" = PDi, "PEi" = PEi, "survival" = survival) - - custom_example = list(custom_interv = list("id" = "new_intervention", - "description" = "new intervention parameterisation", - parameterisation = "custom parameterisation", - "effects" = effects_list)) - - # use default values for other parameters - my_default_model= build_model_obj(vec_p = def_vector_params(), - hosts_p = def_host_params(), - activity = def_activity_patterns(), - total_pop = 2000) - - expect_error(def_interventions_effects( - intervention_list = custom_example, - model_p = my_default_model, num_ip_points = 3)) -}) +# test_that("test: check loading custom effects with wrong dimension", { +# # create custom parameter values +# Kvi=c(0.021, 0.039, 0.004) +# alphai = matrix(data = c(0.00031, 0.00043, 0.00075, +# 0.00028, 0.00053, 0.00043, +# 0.00045, 0.00076, 0.00032, 0.00031), ncol = 2) +# +# PBi = matrix(data = c(0.23, 0.88, 0.99, +# 0.55, 0.65, 0.67, +# 0.53, 0.43, 0.698), ncol = 3) +# +# PCi = matrix(data = c(0.32, 0.21, 0.12, +# 0.321, 0.432, 0.33, +# 0.55, 0.54, 0.42), ncol = 3) +# +# PDi = matrix(data = c(0.822, 0.621, 0.712, +# 0.921, 0.732, 0.933, +# 0.355, 0.654, 0.942), ncol = 3) +# +# PEi = matrix(data = c(0.82, 0.63, 0.742, +# 0.521, 0.52, 0.93, +# 0.85, 0.54, 0.94), ncol=3) +# +# survival = c(0.54, 0.67, 0.99) +# +# effects_list = list("Kvi"=Kvi, "alphai" = alphai, "PBi" = PBi, "PCi" = PCi, +# "PDi" = PDi, "PEi" = PEi, "survival" = survival) +# +# custom_example = list(custom_interv = list("id" = "new_intervention", +# "description" = "new intervention parameterisation", +# parameterisation = "custom parameterisation", +# "effects" = effects_list)) +# +# # use default values for other parameters +# my_default_model= build_model_obj(vec_p = def_vector_params(), +# hosts_p = def_host_params(), +# activity = def_activity_patterns(), +# total_pop = 2000) +# +# expect_error(def_interventions_effects( +# intervention_list = custom_example, +# model_p = my_default_model, num_ip_points = 3)) +# }) diff --git a/vignettes/AnophelesModel.Rmd b/vignettes/AnophelesModel.Rmd index 88cf2f7..69bc563 100644 --- a/vignettes/AnophelesModel.Rmd +++ b/vignettes/AnophelesModel.Rmd @@ -624,7 +624,7 @@ been used to estimate the confidence intervals of the vectorial capacity: ```{r, dpi=150, fig.cap="Impact of interventions on vectorial capacity including the variability in the entomological parameters specific to the mosquito species."} impact_gambiae = calculate_impact_var(mosquito_species = "Anopheles gambiae", activity_patterns = "default_Anopheles_gambiae", - interventions = intervention_vec, + interventions = intervention_obj_examples, n_sample_points = 10, plot_result = FALSE) plot_impact_var("Anopheles gambiae", impact_gambiae)