diff --git a/DESCRIPTION b/DESCRIPTION index 52e84ef..e7a33f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: motrap.micro +Package: ramp.micro Type: Package Title: *Mo*squito *Tr*ansmitted *P*athogen *Micro*simulation with Behavioral States Version: 0.1.0 @@ -11,8 +11,8 @@ Description: A set of algorithms to setup, simulate, and analyze systems of equa License: GPL-3 Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 -URL: https://dd-harp.github.io/motrap.micro/ +RoxygenNote: 7.3.1 +URL: https://dd-harp.github.io/ramp.micro/ Imports: stats, deldir, diff --git a/vignettes/landscapes.R b/vignettes/landscapes.R index 30c27e1..d8eef92 100644 --- a/vignettes/landscapes.R +++ b/vignettes/landscapes.R @@ -2,7 +2,7 @@ library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) ## ----------------------------------------------------------------------------- dd = seq(0, 5, by = 0.01) diff --git a/vignettes/landscapes.Rmd b/vignettes/landscapes.Rmd index 8ed5072..13dd5bb 100644 --- a/vignettes/landscapes.Rmd +++ b/vignettes/landscapes.Rmd @@ -11,7 +11,7 @@ vignette: > library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) ``` diff --git a/vignettes/landscapes.html b/vignettes/landscapes.html index a102d17..8f3f167 100644 --- a/vignettes/landscapes.html +++ b/vignettes/landscapes.html @@ -340,24 +340,25 @@

The Microsimulation Landscape

+
## Warning: package 'viridis' was built under R version 4.3.2

Kernel Shapes

-
dd = seq(0, 5, by = 0.01)
-k1 = make_kF_mix(0, 2, 1, 1.5)
-k2 = make_kF_mix(0.1, 2, 1, delta=1.5)
-k3 = make_kF_mix(0, 2, 1, s=.5)
-k4 = make_kF_mix(0, 2, 1, s=.5, gamma=2)
-k5 = make_kF_mix(0, 2, 1, s=2)
-k6 = make_kF_mix(0, 2, 1, s=2, gamma=2)
-plot(dd, k1(dd), type = "l", xlab = "Distance", ylab = "Weight")
-lines(dd, k2(dd), lty = 2)
-lines(dd, k3(dd), col = "violet")
-lines(dd, k4(dd), col = "slateblue")
-lines(dd, k5(dd), col = "tomato4", lty=2)
-lines(dd, k6(dd), col = "darkorange3", lty=2)
+
dd = seq(0, 5, by = 0.01)
+k1 = make_kF_mix(0, 2, 1, 1.5)
+k2 = make_kF_mix(0.1, 2, 1, delta=1.5)
+k3 = make_kF_mix(0, 2, 1, s=.5)
+k4 = make_kF_mix(0, 2, 1, s=.5, gamma=2)
+k5 = make_kF_mix(0, 2, 1, s=2)
+k6 = make_kF_mix(0, 2, 1, s=2, gamma=2)
+plot(dd, k1(dd), type = "l", xlab = "Distance", ylab = "Weight")
+lines(dd, k2(dd), lty = 2)
+lines(dd, k3(dd), col = "violet")
+lines(dd, k4(dd), col = "slateblue")
+lines(dd, k5(dd), col = "tomato4", lty=2)
+lines(dd, k6(dd), col = "darkorange3", lty=2)

diff --git a/vignettes/point_sets.R b/vignettes/point_sets.R index dd734d6..81cadf6 100644 --- a/vignettes/point_sets.R +++ b/vignettes/point_sets.R @@ -2,7 +2,7 @@ library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) ## ----fig.height=5, fig.width=5------------------------------------------------ par(bty = "o") diff --git a/vignettes/point_sets.Rmd b/vignettes/point_sets.Rmd index cef0252..6c95c27 100644 --- a/vignettes/point_sets.Rmd +++ b/vignettes/point_sets.Rmd @@ -11,7 +11,7 @@ vignette: > library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) ``` diff --git a/vignettes/point_sets.html b/vignettes/point_sets.html index bddd392..ade28cc 100644 --- a/vignettes/point_sets.html +++ b/vignettes/point_sets.html @@ -343,14 +343,14 @@

Making Point Sets

library(viridisLite)
 library(knitr)
 library(viridis)
-library(motrap.micro)
+library(ramp.micro)

Introduction

This

par(bty = "o")
 xy = runif(50, -5, 5)
 plot(xy, xaxt = "n", yaxt = "n", xlab = "", ylab="")
-

+

diff --git a/vignettes/simulation.R b/vignettes/simulation.R index 3107402..efc991f 100644 --- a/vignettes/simulation.R +++ b/vignettes/simulation.R @@ -2,15 +2,16 @@ library(viridisLite) library(knitr) library(viridis) -#library(motrap.micro) -devtools::load_all() +library(ramp.micro) +#devtools::load_all() ## ----------------------------------------------------------------------------- set.seed(24328) bb = unif_xy(256, -17, 17) qq = unif_xy(289, -17, 17) -## ----fig.height=7, fig.width=7------------------------------------------------ +## ----fig.height=6, fig.width=6------------------------------------------------ +par(mar = c(1,1,1,1)) plot_points_bq(bb, qq) ## ----------------------------------------------------------------------------- @@ -52,5 +53,11 @@ model <- SIM(model) # devtools::load_all() ## ----fig.height=6, fig.width=6, echo=F---------------------------------------- -plot_points(model, bwts = model$states$M$B_t[[201]], qwts= model$states$M$B_t[[201]]) +par(mar = c(1,1,1,1)) +plot_points(model, bwts = model$states$M$B_t[[201]], qwts= model$states$M$B_t[[201]], max_pt_sz=2) + +## ----eval=F, echo=F----------------------------------------------------------- +# model1 <- model +# model1$Lpar$xi = .1 +# model1 <- SIM(model1) diff --git a/vignettes/simulation.Rmd b/vignettes/simulation.Rmd index 8ba26dc..4dd2f39 100644 --- a/vignettes/simulation.Rmd +++ b/vignettes/simulation.Rmd @@ -11,7 +11,7 @@ vignette: > library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) #devtools::load_all() ``` diff --git a/vignettes/simulation.html b/vignettes/simulation.html index e2b46ac..07bf9b2 100644 --- a/vignettes/simulation.html +++ b/vignettes/simulation.html @@ -340,7 +340,6 @@

Simulation

-
## ℹ Loading motrap.micro

Introduction

If we want to target vector interventions for malaria spatially, @@ -382,26 +381,27 @@

Resource Landscape

To get started, we need to set up a microsimulation landscape, which includes point sets and matrices describing dispersal among those point sets:

-
set.seed(24328)
-bb = unif_xy(256, -17, 17) 
-qq = unif_xy(289, -17, 17) 
-
plot_points_bq(bb, qq)
-

+
set.seed(24328)
+bb = unif_xy(256, -17, 17) 
+qq = unif_xy(289, -17, 17) 
+
par(mar = c(1,1,1,1))
+plot_points_bq(bb, qq)
+

Dispersal

-
kFb = make_kF_exp(k=2, s=1, gamma=1.5)
-kFq = make_kF_exp(k=2, s=2, gamma=2)
-
dd = seq(0, 5, by = 0.01)
-plot(dd, kFb(dd), type = "l", col = "darkred", xlab = "Distance", ylab = "Weight")
-lines(dd, kFq(dd), type = "l", col = "darkblue")
+
kFb = make_kF_exp(k=2, s=1, gamma=1.5)
+kFq = make_kF_exp(k=2, s=2, gamma=2)
+
dd = seq(0, 5, by = 0.01)
+plot(dd, kFb(dd), type = "l", col = "darkred", xlab = "Distance", ylab = "Weight")
+lines(dd, kFq(dd), type = "l", col = "darkblue")

-
Psi_bb = make_Psi_xx(bb, kFb)
-Psi_qb = make_Psi_xy(bb, qq, kFq)
-Psi_bq = make_Psi_xy(qq, bb, kFb)
-Psi_qq = make_Psi_xx(qq, kFq)
-
par(mfcol = c(2,2), mar = c(1,2,1,2))
-plot_Psi_BQ(bb, qq, Psi_bb, Psi_qb, Psi_bq, Psi_qq)
+
Psi_bb = make_Psi_xx(bb, kFb)
+Psi_qb = make_Psi_xy(bb, qq, kFq)
+Psi_bq = make_Psi_xy(qq, bb, kFb)
+Psi_qq = make_Psi_xx(qq, kFq)
+
par(mfcol = c(2,2), mar = c(1,2,1,2))
+plot_Psi_BQ(bb, qq, Psi_bb, Psi_qb, Psi_bq, Psi_qq)

@@ -412,22 +412,27 @@

Setting up a model

values. To streamline the process, we developed a function called setup_model that accepts some basic arguments and that returns a fully defined model:

-
opts_d = list(kFb = kFb, kFq = kFq)
-model = setup_model(bb, qq, dispersal_opts=opts_d)
-
names(model)
+
opts_d = list(kFb = kFb, kFq = kFq)
+model = setup_model(bb, qq, dispersal_opts=opts_d)
+
names(model)
## [1] "b"     "q"     "nb"    "nq"    "Mpar"  "Mvars" "terms" "Lpar"  "Lvars"
-
names(model$Mpar)
+
names(model$Mpar)
##  [1] "setup"  "Psi_bb" "Psi_qb" "Psi_bq" "Psi_qq" "psiQ"   "ova"    "Mbb"   
-##  [9] "Mqb"    "Mbq"    "Mqq"    "Mlb"    "bigM"   "eip"
-
names(model$Lpar)
+## [9] "Mqb" "Mbq" "Mqq" "Mbl" "bigM" "eip" +
names(model$Lpar)
## [1] "pL"    "zeta"  "theta" "xi"

Solving

We can solve the model and produce output by calling the function SIM

-
model <- SIM(model)
-

+
model <- SIM(model)
+

The population densities are highly heterogeneous, even though the +habitats and blood feeding sites that are all alike in every way except +location. Here, the size of each point scales with the density of the +adult, female mosquito population at that point (red = blood feeding, +blue = egg laying).

+

diff --git a/vignettes/test_plots.R b/vignettes/test_plots.R index 8e85a01..b15e46b 100644 --- a/vignettes/test_plots.R +++ b/vignettes/test_plots.R @@ -2,7 +2,7 @@ library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) #suppressWarnings(devtools::load_all() ) set.seed(25) diff --git a/vignettes/test_plots.Rmd b/vignettes/test_plots.Rmd index 4cf4878..dae0f16 100644 --- a/vignettes/test_plots.Rmd +++ b/vignettes/test_plots.Rmd @@ -11,7 +11,7 @@ vignette: > library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) #suppressWarnings(devtools::load_all() ) set.seed(25) ``` diff --git a/vignettes/test_plots.html b/vignettes/test_plots.html index f6f3d9d..989609b 100644 --- a/vignettes/test_plots.html +++ b/vignettes/test_plots.html @@ -343,7 +343,7 @@

On Dispersal Matrices

library(viridisLite)
 library(knitr)
 library(viridis)
-library(motrap.micro)
+library(ramp.micro)
 #suppressWarnings(devtools::load_all() )
 set.seed(25)
diff --git a/vignettes/visualizing_dispersal.R b/vignettes/visualizing_dispersal.R index ef1de17..bb80871 100644 --- a/vignettes/visualizing_dispersal.R +++ b/vignettes/visualizing_dispersal.R @@ -2,7 +2,7 @@ library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) set.seed(25) ## ----echo=F, eval=F----------------------------------------------------------- diff --git a/vignettes/visualizing_dispersal.Rmd b/vignettes/visualizing_dispersal.Rmd index 0206cf6..fa1da5b 100644 --- a/vignettes/visualizing_dispersal.Rmd +++ b/vignettes/visualizing_dispersal.Rmd @@ -12,7 +12,7 @@ vignette: > library(viridisLite) library(knitr) library(viridis) -library(motrap.micro) +library(ramp.micro) set.seed(25) ``` diff --git a/vignettes/visualizing_dispersal.html b/vignettes/visualizing_dispersal.html index 1c42f20..de903df 100644 --- a/vignettes/visualizing_dispersal.html +++ b/vignettes/visualizing_dispersal.html @@ -343,7 +343,7 @@

Visualizing Micro-Dispersal

library(viridisLite)
 library(knitr)
 library(viridis)
-library(motrap.micro)
+library(ramp.micro)
 set.seed(25)

Introduction