Version: | 2.2.9 |
Date: | 2024-03-12 |
Title: | A Unified Mechanistic Model for the Population Dynamics of Invasive Aedes Mosquitoes |
Depends: | R (≥ 4.0.0) |
Imports: | abind, doParallel, drc, foreach, geosphere, methods, parallel, terra |
BugReports: | https://github.com/mattmar/dynamAedes |
Description: | Generalised model for population dynamics of invasive Aedes mosquitoes. Rationale and model structure are described here: Da Re et al. (2021) <doi:10.1016/j.ecoinf.2020.101180> and Da Re et al. (2022) <doi:10.1101/2021.12.21.473628>. |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
Language: | en-GB |
LazyData: | true |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
RoxygenNote: | 7.3.1 |
Suggests: | rmarkdown, knitr, eesim, gstat, stats, ggplot2, dplyr, lubridate, stringr |
Config/testthat/edition: | 3 |
URL: | https://mattmar.github.io/dynamAedes/ |
NeedsCompilation: | no |
Packaged: | 2024-03-12 21:27:03 UTC; matteo |
Author: | Matteo Marcantonio [aut, cre], Daniele Da Re [aut] |
Maintainer: | Matteo Marcantonio <marcantoniomatteo@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-03-12 22:10:02 UTC |
Function 2 to start Beta functions: Functions taken from https://github.com/OnofriAndreaPG/aomisc
Description
Function 1 to start Beta functions
Usage
.DRC.beta()
Value
No return value, called for side effects in drm
Log-Normal probability density of short active dispersal
Description
Log-Normal probability density of short active dispersal from Marcantonio et al. 2019; Marini et al. 2019. 0 to 600 m with resolution of 10 m.
Usage
.a.a_disp.f(sp, max.a.disp, disp.bins)
Value
vector of rates.
Daily rate of gonotrophic cycle
Description
Daily rate of gonotrophic cycle, i.e., daily rate of adult females completing the cycle from bloodmeal to the first day of oviposition
Usage
.a.gono_rate.f(temp.new, sp)
Value
vector of rates.
Oviposition rate
Description
Oviposition rate, i.e., number of eggs laid per female/day at different temperature
Usage
.a.ovi_rate.f(temp.new, sp)
Value
vector of rates.
Adult female daily mortality rate
Description
Adult female daily mortality rate at different temperatures
Usage
.a.surv_rate.f(temp.new, sp)
Value
vector of rates.
Function 1 to start Beta functions: Functions taken from https://github.com/OnofriAndreaPG/aomisc
Description
Function 1 to start Beta functions
Usage
.beta.fun(X, b, d, Xb, Xo, Xc)
Value
No return value, called for side effects in .DRC.beta
Function 3 to start Beta functions: Functions taken from https://github.com/OnofriAndreaPG/aomisc
Description
Function 1 to start Beta functions
Usage
.beta.init(mCall, LHS, data)
Value
No return value, called for Beta function initiation in drm
Diapause eggs daily survival rate
Description
Diapause eggs daily survival rate at different temperature
Usage
.d.surv_rate.f(temp.new, sp)
Value
vector of rates.
Allocation of diapause eggs
Description
Allocation of diapause eggs dependent on photoperiod
Usage
.e.dia_rate.f(photo.new, sp)
Value
vector of rates.
Egg hatching rate
Description
Egg hatching rate: this rate decides embryonated eggs which hatch or stay
Usage
.e.hatch_rate.f(temp.new, sp)
Value
vector of rates.
Egg daily survival rate
Description
Egg daily survival rate at different temperature
Usage
.e.surv_rate.f(temp.new, sp)
Value
vector of rates.
Euclidean distance
Description
Return Euclidean distance
Usage
.euc(xs, ys)
Value
float. An euclidean distance.
Immature Density-dependent mortality rate
Description
Immature Density-dependent mortality
Usage
.i.ddmort_rate.f(dens.new)
Value
vector of rates.
Immature daily emergence rate
Description
Immature daily emergence rate at different temperature
Usage
.i.emer_rate.f(temp.new, sp)
Value
vector of rates.
Immature daily survival rat
Description
Immature daily survival rate at different temperature
Usage
.i.surv_rate.f(temp.new, sp)
Value
vector of rates.
Euclidean distance from a pair of coordinates
Description
Returns Euclidean distance from a pair of coordinates
Usage
.meuc(c1, c2, coords)
Value
float. Vector of Euclidean distances.
Distance moved by mosquito populations
Description
Return quantiles of distance moved by mosquito populations
Usage
.returndis(distl = NA, days = NA, breaks = breaks)
Value
vector of quantiles of distances.
Reference list for Aedes stages and substages
Description
Reference files to match simulation output matrices with Aedes stages and substages as modelled in dynamAedes. The list contains:
Usage
data(AedeslifeHistoryList)
Format
A list of two matrices
Details
speciesheet: description of each substage for each species
codesheet: reference coding to match substages to simulation output
Summaries of mosquito abundance
Description
Summaries of mosquito abundance at each life stage and sub-stage for each day.
Usage
adci(
input_sim = NULL,
stage = NULL,
sub_stage = NULL,
breaks = c(0.25, 0.5, 0.75),
eval_date = NULL,
n.clusters = 1,
type = "N"
)
Arguments
input_sim |
matrix. |
stage |
character. "Eggs", "Juveniles", "Adults", or "DiapauseEggs" or any shorter attempt longer than 3 letters. |
sub_stage |
character. For uncompressed outputs only, defines the substage of interest. Please see cheat-sheet table. |
breaks |
numeric vector. Quantile breaks, default the first, the second and the third quartile: |
eval_date |
positive integer. Define the day to evaluate from the first day of introduction. Note that this can be particularly demanding in the case of spatial outputs. |
n.clusters |
integer. Number of parallel processes. |
type |
character. The type of output. Set "O" to force overall time-only summary over spatial. Default is "N" (normal). |
Value
Returns a data frame or a raster with the summary of mosquito abundance at each life stage for each day.
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re dare.daniele@gmail.com
Estimate of of mosquito dispersal
Description
Estimates of dispersal (in km^2) for the simulated mosquito population when scale = "lc"
.
Usage
dici(
input_sim = NULL,
eval_date = NULL,
breaks = c(0.25, 0.5, 0.75),
space = FALSE
)
Arguments
input_sim |
matrix. |
eval_date |
numeric. Define the day of evaluation; it refers to the column number of the input temperature matrix. |
breaks |
numeric vector. Quantile breaks, default interquartile range: |
space |
See below for more details. |
Value
if space=FALSE then it returns a dataframe with quantiles of the distribution of dispersal distances; if space=TRUE (experimental) then it returns the invaded cells on the last day of model simulations for each of the iterations.
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re daniele.dare@uclouvain.be
Life cycle simulation of Aedes mosquitoes
Description
Function to simulate population dynamics of Aedes mosquitoes
Usage
dynamAedes.m(
species = NULL,
intro.eggs = 0,
intro.deggs = 0,
intro.adults = 0,
intro.juveniles = 0,
scale = NULL,
intro.cells = NULL,
jhwv = NULL,
temps.matrix = NULL,
startd = 1,
endd = NA,
cells.coords = NULL,
coords.proj4 = NA,
lat = NA,
long = NA,
road.dist.matrix = NULL,
avgpdisp = NA,
pDispersal = TRUE,
iter = 1,
n.clusters = 1,
cluster.type = "PSOCK",
compressed.output = TRUE,
suffix = NA,
cellsize = 250,
maxadisp = 600,
dispbins = 10,
verbose = 0,
seeding = FALSE
)
Arguments
species |
character. Select what species to model: |
intro.eggs |
positive integer. number of introduced eggs, default |
intro.deggs |
positive integer. number of introduced diapause eggs, default |
intro.adults |
positive integer. number of introduced adults, default |
intro.juveniles |
positive integer. number of introduced juveniles, default |
scale |
character. Define the model spatial scale: punctual/weather station "ws", local "lc", or regional "rg". Active and passive dispersal is enabled only for |
intro.cells |
positive integer. One or more cells (id) where to introduce the population at local ("lc") scale. If intro.cells=NULL, then a random cell is used for introduction; If intro.cells is a vector of cell ids then a cell is drawn at random from the vector (with repetition) for introduction in each model iteration. |
jhwv |
positive integer. Juvenile-habitat water volume, define the volume (L) of water habitat presents in each spatial unit (parametrised with data retrieved from doi:10.1111/1365-2664.12620). Default |
temps.matrix |
matrix. A matrix of daily (average) temperatures (in degrees Celsius degree x 1000) used to fit the life cycle rates. This matrix must be organised with the daily temperature observations as columns and the geographic position of the i-grid cell as rows. Importantly, the first column must match |
startd |
Character date (ISO format "%Y-%m-%d"). Date of start of simulations. |
endd |
Character date (ISO format "%Y-%m-%d"). Date of end of simulation. It can be |
cells.coords |
matrix. A matrix reporting the spatial coordinates of the temperature observations. |
coords.proj4 |
string. Proj4 string of cell coordinates used for the calculation of photoperiod. |
lat |
numeric. Latitude value of the area of interested used to derive the photoperiod (and thus the diapause eggs allocation function). |
long |
numeric. Longitude value of the area of interested used to derive the photoperiod (and thus the diapause eggs allocation function) |
road.dist.matrix |
matrix. when |
avgpdisp |
optional. when |
pDispersal |
boolean. if TRUE (default) then the model considers passive dispersal. |
iter |
positive integer. Define the number of model iterations. |
n.clusters |
positive integer. Defines the number of parallel processes. |
cluster.type |
character. Defines the type of cluster, default "PSOCK". |
compressed.output |
logical. Default TRUE, if FALSE provide abundance for each model's subcompartiment; if FALSE abundances are summed per compartment. |
suffix |
character. Model output suffix for output RDS. |
cellsize |
positive integer. When |
maxadisp |
positive integer. When |
dispbins |
positive integer. When scale = "lc", defines the resolution of the active dispersal kernel, default dispbins = 10. |
verbose |
integer. if 1 then an overview of population dynamics is printed in the console, if 2 more information on population dynamics are printed out. Default is 0 (silent). |
seeding |
logical, default |
Value
Matrix or a list of matrices containing, for each iteration, the number of individuals in each life stage per day (and for each grid cell of the study area if scale="lc" or "rg"). If the argument compressed.output=FALSE (default TRUE), the model returns the daily number of individuals in each life stage sub-compartment.
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re daniele.dare@uclouvain.be
See Also
Beta regression functions were taken from the R package aomisc
, which may be available at https://github.com/OnofriAndreaPG/aomisc.
Examples
## Run dynamAedes at local scale for 5 days
# Make a toy temperature time series
w <- matrix(seq(20,25,length.out=5),ncol=5)*1000
# Run the model
simout <- dynamAedes.m(
species="koreicus",
scale="ws",
intro.eggs=10,
jhwv=2,
temps.matrix=w,
startd="2021-06-21",
endd="2021-06-25",
lat=42,
long=8,
n.clusters=1,
iter=1,
compressed.output=TRUE,
verbose=FALSE)
S4 class representing the output of dynamAedes.m
Description
S4 class representing the output of dynamAedes.m
Slots
species
Character. The simulated species.
scale
Character. The scale of the simulation.
start_date
Character. The introduction date.
end_date
Character. The end date of the simulation.
n_iterations
Numeric. The number of iterations.
stage_intro
Character. The introduced mosquito stage.
n_intro
Numeric. The number of propagules introduced.
coordinates
Matrix. The coordinates of each cell.
compressed_output
Logical. If output is at stage or substage level.
jhwv
Numeric. The volume of water in the system.
Number of invaded cells
Description
Compute a summary of the number of invaded cells over model iterations
Usage
icci(input_sim = NA, eval_date = NULL, breaks = c(0.25, 0.5, 0.75))
Arguments
input_sim |
matrix. |
eval_date |
numeric. Define the day of evaluation; it refers to the column number of the input temperature matrix. |
breaks |
numeric vector. Quantile breaks, default interquartile range: |
Value
icci
returns quantiles of the distribution of the invaded cell number for the specified. The output should be interpreted according to model spatial scale (i.e. scale='rg'
or scale='lc'
give different interpretation).
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re daniele.dare@uclouvain.be
Max method for dynamAedesClass Provides the max number of days with at least one propagule in the system (any stage) along iterations.
Description
Max method for dynamAedesClass Provides the max number of days with at least one propagule in the system (any stage) along iterations.
Usage
## S4 method for signature 'dynamAedesClass'
max(x, na.rm = FALSE)
Arguments
x |
An object of class |
na.rm |
logic. |
Value
An integer.
Examples
## Not run:
max(sim)
## End(Not run)
Min method for dynamAedesClass Provides the min number of days with at least one propagule in the system (any stage) along iterations.
Description
Min method for dynamAedesClass Provides the min number of days with at least one propagule in the system (any stage) along iterations.
Usage
## S4 method for signature 'dynamAedesClass'
min(x, na.rm = FALSE)
Arguments
x |
An object of class |
na.rm |
logic. |
Value
An integer.
Examples
## Not run:
min(sim)
## End(Not run)
Proportion of successful introductions
Description
Compute the proportion of "successful" introductions.
Usage
psi(input_sim = NULL, eval_date = NULL)
Arguments
input_sim |
matrix. |
eval_date |
positive integer. define the day(s) to calculate the proportion of successful introductions which should match the column number of the temperature matrix used to inform the model. |
Value
psi
returns the proportion of model iterations that resulted in a viable mosquito population (defined as: iterations with at least one individual alive in any life stage) at a given date.
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re daniele.dare@uclouvain.be
Probability of successful introduction (spatial)
Description
Compute the proportion of successful introductions per each cell of the grid.
Usage
psi_sp(input_sim = NULL, eval_date = NULL, n.clusters = 1)
Arguments
input_sim |
matrix. |
eval_date |
positive integer. Define the day(s) to calculate the proportion of successful introductions which should match the column number of the temperature matrix used to inform the model. |
n.clusters |
positive integer. Define the number of parallel processes. |
Value
psi_sp
returns a raster with the proportion of model iterations that resulted in a viable mosquito population at a given date for a given life stage in each cell of the grid.
Author(s)
Matteo Marcantonio marcantoniomatteo@gmail.com, Daniele Da Re daniele.dare@uclouvain.be
Temporal downscaling of entomological surveillance observations
Description
Temporal downscaling of entomological surveillance observations
Usage
spreader(
mydf = NULL,
date.field = NULL,
value.field = NULL,
counter.field = NULL,
seed = 123
)
Arguments
mydf |
A data.frame. |
date.field |
character, name of field containing dates. |
value.field |
integer, name of field containing the number of individuals sampled. |
counter.field |
integer, name of the field containing the number of days/weeks between each sampling. This is optional, if NULL then the function will compute the value assuming the trap was active during the whole period between two consecutive samplings. |
seed |
integer, define the seed for the binomial draws, default |
Value
Returns a data.frame with the "adjusted value", i.e. the observation spread over the period of activity of the trap
Author(s)
Daniele Da Re dare.daniele@gmail.com, Giovanni Marini dare.daniele@gmail.com
Summary method for dynamAedesClass Provides a summary of simulations based on the dynamAedesClass.
Description
Summary method for dynamAedesClass Provides a summary of simulations based on the dynamAedesClass.
Usage
## S4 method for signature 'dynamAedesClass'
summary(object)
Arguments
object |
An object of class |
Value
A character vector with the summary details of the simulation.
Examples
## Not run:
summary(sim)
## End(Not run)