community_sim: community_bam: Community 'bam'

View source: R/community_sim.R

community_simR Documentation

community_bam: Community bam

Description

Estimate community dynamics using the bam framework

Usage

community_sim(en_models, ngbs_vect, init_coords, nsteps, parallel, ...)

Arguments

en_models

A stack or directory with the ecological niche models for each species in the community.

ngbs_vect

A vector

init_coords

A data.frame with 3 columns: sp_name, x and y; x is the longitude and y is the latitude of initial disperal points

nsteps

Number of iteration steps for the simuation.

parallel

TRUE if the simulation should be run in parallel. Default FALSE

...

Parameters of the functions of the bam class

Examples

## Not run: 
lagos_path <- system.file("extdata/conejos",
                          package = "bam")
enm_path <- list.files(lagos_path,
                       pattern = ".tif",
                       full.names = TRUE)
en_models <- raster::stack(enm_path)
ngbs_vect <- sample(1:2,replace = TRUE,
                    size = raster::nlayers(en_models))
init_coords <- read.csv(file.path(lagos_path,
                                  "lagos_initit.csv"))
nsteps <- 30
sdm_comm <- bam::community_sim(en_models = enm_path,
                               ngbs_vect = ngbs_vect,
                               init_coords = init_coords,
                               nsteps = nsteps,
                               threshold = 0.1)


## End(Not run)

luismurao/bam documentation built on Nov. 28, 2022, 3:02 p.m.