R6 class for encapsulating and dynamically generating
paleopop_simulator results, as well as optional
Generator for niche carrying capacity and/or human
A list of dynamically attached attributes (name-value pairs).
A vector of model attribute names.
Region (or inherited class) object specifying the study region.
Data frame (or matrix) of X-Y population coordinates (WGS84) in longitude (degrees West) and latitude (degrees North).
Number of simulation time steps.
Optional number of initial 'burn-in' time steps to be ignored.
Optional binary mask array (matrix), data frame, or raster (stack) for each cell at each time-step of the simulation including burn-in.
Optional time-step range (indices) for trend calculations (assumes indices begin after the burn-in when utilized).
Matrix of population abundance across simulation time-steps (populations rows by duration columns).
Trend or average Sen's
slope of total abundance (optionally across a time-step interval).
Matrix of population expected minimum abundance (EMA) across simulation time-steps (populations rows by duration columns).
Array of population extirpation times.
The weighted centroid of cells occupied in the time-step prior to the extirpation of all populations (if occurred).
Matrix of the number of animals harvested from each population at each time-step (populations rows by duration columns).
Array of the number of populations occupied at each time-step.
Optional matrix of simulation input carrying capacity to be combined with results (populations rows by duration columns).
Optional matrix of simulation input human density to be combined with results (populations rows by duration columns).
Nested simulation results for all cells.
Parent simulation results for individual cells.
Default value/attribute utilized when applying primitive metric functions (e.g. max) to the results.
A list of alternative alias names for model attributes (form:
alias = "attribute") to be used with the set and get attributes methods.
A vector of error messages encountered when setting model attributes.
A vector of warning messages encountered when setting model attributes.
The objects of this class are cloneable with this method.
PaleoPopResults$clone(deep = FALSE)
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
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.