models2pam: models2pam: Converts binary rasters to a PAM

View source: R/models2pam.R

models2pamR Documentation

models2pam: Converts binary rasters to a PAM

Description

Function to convert binary raster models to a Presence Absences Matrix.

Usage

models2pam(mods_stack, sparse = TRUE, parallel = FALSE, ncores = 4)

Arguments

mods_stack

A raster stack containing binay models of each species in the community.

sparse

Logical. If TRUE the PAM will be returned as a sparse matrix.

parallel

Logical. If TRUE computations will be done in parallel

ncores

Integer. Number of cores to run the parallel process.

Value

A PAM.

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) >0.01
pam <- bam::models2pam(en_models,sparse=FALSE,parallel=T,ncores=10)

## End(Not run)

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