setwd(here::here())

Installation

The cdyns package can be installed with the following script:

#install.packages("remotes")
remotes::install_github("aterui/cdyns")
library(cdyns)

Overview

The R package cdyns is a collection of functions to perform community dynamics simulations with stock enhancement. The current version of the package includes the following functions:

Instruction

Basic usage

The key arguments are n_timestep (the number of time step to be saved), n_warmup (warm-up period during which seeding happens), n_burnin (burn-in period for eliminating initial condition effects), and the number of species in a community (n_species). The community dynamics are simulated using either a Ricker equation (model = "ricker") or a Beverton-Holt equation (model = "bh").

Sample script:

library(cdyns)
sim <- cdynsim(n_timestep = 1000,
               n_warmup = 200,
               n_burnin = 200,
               n_species = 10)

This script returns the following:

print(sim)

Stock enhancement

Stock enhancement can be added using stock argument. For example, stock = 100 adds 100 individuals to species 1 every time step:

sim <- cdynsim(n_timestep = 1000,
               n_warmup = 200,
               n_burnin = 200,
               n_species = 10,
               stock = 100)


aterui/cdyns documentation built on Nov. 29, 2024, 9:32 a.m.