gen3sis: gen3sis: General Engine for Eco-Evolutionary Simulations

gen3sisR Documentation

gen3sis: General Engine for Eco-Evolutionary Simulations

Description

Contains an engine for spatially-explicit eco-evolutionary mechanistic models with a modular implementation and several support functions. It allows exploring the consequences of ecological and macroevolutionary processes across realistic or theoretical spatio-temporal landscapes on biodiversity patterns as a general term.

Details

Gen3sis is implemented in a mix of R and C++ code, and wrapped into an R-package. All high-level functions that the user may interact with are written in R, and are documented via the standard R / Roxygen help files for R-packages. Runtime-critical functions are implemented in C++ and coupled to R via the Rcpp framework. Additionally, the package provides several convenience functions to generate input data, configuration files and plots, as well as tutorials in the form of vignettes that illustrate how to declare models and run simulations.

References

O. Hagen, B. Flück, F. Fopp, J.S. Cabral, F. Hartig, M. Pontarp, T.F. Rangel, L. Pellissier. (2021). gen3sis: A general engine for eco-evolutionary simulations of the processes that shape Earth’s biodiversity. PLoS biology

See Also

create_input_config create_input_landscape run_simulation plot_summary

Examples

## Not run: 

# 1. Load gen3sis and all necessary input data is set (landscape and config).

library(gen3sis)

# get path to example input inside package
datapath <- system.file(file.path("extdata", "WorldCenter"), package = "gen3sis")
path_config <- file.path(datapath, "config/config_worldcenter.R")
path_landscape <- file.path(datapath, "landscape")

# 2. Run simulation

sim <- run_simulation(config = path_config, landscape = path_landscape)

# 3. Visualize the outputs

# plot summary of entire simulation
plot_summary(sim)

# plot richness at a given time-step 
# this only works if species is saved for this time-step
landscape_t_150 <- readRDS(file.path(datapath, 
"output", "config_worldcenter", "landscapes", "landscape_t_150.rds"))   
species_t_150 <- readRDS(file.path(datapath, 
"output", "config_worldcenter", "species", "species_t_150.rds"))   
plot_richness(species_t_150, landscape_t_150)   


## End(Not run)

gen3sis documentation built on Nov. 22, 2023, 5:07 p.m.