This is an R package for simulating the spread of pests and pathogens. The package is an R package with multiple functions built around the PoPS (Pest or Pathogen Spread) model implemented in the C++ library maintained in the PoPS Core Repository.
PoPs is a stochastic spread model of pests and pathogens in forest and agricultural landscapes to learn more visit popsmodel.org. The R package provides an easy way for researchers to calibrate, validate, and test what if scenarios of treatment interventions. The model is also available in GRASS GIS you can install and use r.pops.spread to run the model in GRASS GIS.
If you are on Windows, you need to first install Rtools to get a C++ compiler that R can use.
If you want to install a specific version just change the version number.
install.packages("remotes")
remotes::install_github("ncsu-landscape-dynamics/rpops", ref = "v2.0.0")
library(PoPS)
install.packages("remotes")
remotes::install_github("ncsu-landscape-dynamics/rpops")
library(PoPS)
the PoPS package in R is built on top of PoPS Core C++ library includes:
SI
) and susceptible-exposed-infected (SEI
) model types (model_type
, latency_period
).mortality_rate
, mortality_time_lag
, mortality
).treatments
, treatment_date
, pesticide_duration
).pesticide_duration
> 0).treatment_application
).lethal_temperature
, lethal_month
).natural_dispersal_kernel
, anthropogenic_dispersal_kernel
).seasonality
in months).use_movements
, movements_file
).generate_stochasticity
, establishment_stochasticity
, movement_stochasticity
) and deterministic versions of kernels (deterministic
) other required parameters if reducing stochasticity are (dispersal_percentage
, establishment_probability
).west_rate
, east_rate
, south_rate
, north_rate
) when (use_spreadrates
) is true.north_distance_to_quarantine
, south_distance_to_quarantine
, east_distance_to_quarantine
, west_distance_to_quarantine
) when (use_quarantine
) is true and (quarantine_areas_file
) is provided.escape_probability
).use_overpopulation
, overpopulation_percentage
, leaving_percentage
, leaving_scale_coefficient
).output_frequency
, output_frequency_n
).calibrate:
Calibration of the model parameters using either MCMC (markov chain monte carlo) or ABC (approximate bayesian computation).validate:
Validation of the model using quantiy, allocation, and configuration disagreement.pops_multirun:
Parallel execution of multiple stochastic runs (number_of_cores
used to set cores used if left NULL defaults to using n - 1 cores on the machine). Outputs statistics of infected/infested hosts across multiple runs (simulation_mean
, single_run
, simulation_sd
, simulation_min
, simulation_max
), current state using the median (infected
, exposed
, and susceptible
), average and standard deviations whole area statistics (number_infecteds
, infected_areas
), and probability of infection (probability
) which is the percent of model runs that a cell has at least one infestation/infection.pops:
Runs a single stochastic run of the model. This function is primarily used for automated testing of model functionality.If you use this software or code, please cite the following papers:
In case you are using the automatic management feature in rpops or the steering version of r.pops.spread (from the branch steering), please cite also:
In addition to citing the above paper, we also encourage you to reference, link, and/or acknowledge specific version of the software you are using for example:
Please see the pops-core repository for contributing best practices and release policies. Other than that, just open pull requests against this repo. We suggest following the Style Guide from Hadley for R code.
Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License version 2 or higher is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty. See the GNU General Public License for more details.