Learn R Programming

epizootic (version 2.0.0)

disease_results: Nested functions for initializing, calculating and collecting disease simulator results.

Description

Modular functions for the disease simulator for initializing, calculating and collecting simulator results.

Usage

disease_results(
  replicates,
  time_steps,
  seasons,
  stages,
  compartments,
  coordinates,
  initial_abundance,
  results_selection = NULL,
  results_breakdown = NULL
)

Value

List of result functions:

initialize_attributes = function())

Constructs and returns an initialized nested list for the selected result attributes.

initialize_replicate = function(results)

Initializes and returns nested result attributes at the start of each replicate.

calculate_at_season = function(r, tm, season, segment_abundance, harvested, results)

Appends and calculates (non-NULL) results and returns nested result attributes at the end of each season within time step (tm) within replicate (r).

calculate_at_timestep = function(r, tm, segment_abundance, harvested, results)

Appends and calculates (non-NULL) results and returns nested result attributes at the end of each time step (tm) within replicate (r).

finalize_attributes = function(results)

Finalizes result calculations at the end of the simulation.

Arguments

replicates

Number of replicate simulation runs.

time_steps

Number of simulation time steps.

seasons

Number of seasons per time step.

stages

Number of life cycle stages.

compartments

Number of disease compartments.

coordinates

Data frame (or matrix) of X-Y population coordinates.

initial_abundance

Matrix of initial abundances at each combination of stage and compartment (in rows) for each population (in columns).

results_selection

List of results selection from: "abundance" (default), "ema", "extirpation", "extinction_location", "harvested", "occupancy"; "summarize" (default) or "replicate". "summarize" calculates mean, sd, min and max across replicates. "replicate" returns results separately for each replicate.

results_breakdown

A string with one of these values: "segments" (default), "compartments", "stages" or "pooled." "segments" returns results for each segment (stage x compartment combination.) "compartments" returns results for each disease compartment. "stages" returns results for each life cycle stage. "pooled" returns results that are not broken down by stage or compartment.