| PaleoPopResults | R Documentation |
R6 class for encapsulating and dynamically generating
spatially-explicit paleopop_simulator results, as well as optional
re-generated Generator for niche carrying capacity and/or human
density.
poems::GenericClass -> poems::GenericModel -> poems::SpatialModel -> poems::SimulationResults -> PaleoPopResults
attachedA list of dynamically attached attributes (name-value pairs).
model_attributesA vector of model attribute names.
regionA Region (or inherited class) object specifying the study region.
coordinatesData frame (or matrix) of X-Y population coordinates (WGS84) in longitude (degrees West) and latitude (degrees North).
time_stepsNumber of simulation time steps.
burn_in_stepsOptional number of initial 'burn-in' time steps to be ignored.
occupancy_maskOptional binary mask array (matrix), data frame, or raster (stack) for each cell at each time-step of the simulation including burn-in.
trend_intervalOptional time-step range (indices) for trend calculations (assumes indices begin after the burn-in when utilized).
abundanceMatrix of population abundance across simulation time-steps (populations rows by duration columns).
abundance_trendTrend or average Sen's slope of total abundance (optionally across a time-step interval).
emaMatrix of population expected minimum abundance (EMA) across simulation time-steps (populations rows by duration columns).
extirpationArray of population extirpation times.
extinction_locationThe weighted centroid of cells occupied in the time-step prior to the extirpation of all populations (if occurred).
harvestedMatrix of the number of animals harvested from each population at each time-step (populations rows by duration columns).
occupancyArray of the number of populations occupied at each time-step.
carrying_capacityOptional matrix of simulation input carrying capacity to be combined with results (populations rows by duration columns).
human_densityOptional matrix of simulation input human density to be combined with results (populations rows by duration columns).
allNested simulation results for all cells.
parentParent simulation results for individual cells.
defaultDefault value/attribute utilized when applying primitive metric functions (e.g. max) to the results.
attribute_aliasesA list of alternative alias names for model attributes (form: alias = "attribute") to be used with the set and get attributes methods.
error_messagesA vector of error messages encountered when setting model attributes.
warning_messagesA vector of warning messages encountered when setting model attributes.
clone()The objects of this class are cloneable with this method.
PaleoPopResults$clone(deep = FALSE)
deepWhether to make a deep clone.
library(raster)
library(poems)
# Ring Island example region
coordinates <- data.frame(x = rep(seq(-178.02, -178.06, -0.01), 5),
y = rep(seq(19.02, 19.06, 0.01), each = 5))
template_raster <- Region$new(coordinates = coordinates)$region_raster # full extent
sealevel_raster <- template_raster
template_raster[][c(7:9, 12:14, 17:19)] <- NA # make Ring Island
sealevel_raster[][c(7:9, 12:14, 17:18)] <- NA
raster_stack <- raster::stack(x = append(replicate(9, template_raster), sealevel_raster))
region <- PaleoRegion$new(template_raster = raster_stack)
# Model template
model_template <- PaleoPopModel$new(
region = region,
time_steps = 10,
years_per_step = 12, # years per generational time-step
standard_deviation = 0.1,
growth_rate_max = 0.6,
harvest = FALSE,
populations = region$region_cells,
initial_abundance = seq(9000, 0, -1000),
transition_rate = 1.0,
carrying_capacity = rep(1000, 17),
dispersal = (!diag(nrow = 17, ncol = 17))*0.05,
density_dependence = "logistic",
dispersal_target_k = 10,
occupancy_threshold = 1,
abundance_threshold = 10,
results_selection = c("abundance")
)
# Simulations
results <- paleopop_simulator(model_template)
# Results
results_model <- PaleoPopResults$new(results = results, region = region, time_steps = 10)
results_model$extirpation # cells where the population goes to zero are marked 1
results_model$occupancy # indicates with 0 and 1 which cells are occupied at each time step
results_model$ema # expected minimum abundance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.