model2sparse: model2sparse: Converts a niche model into a diagonal sparse...

View source: R/model2sparse.R

model2sparseR Documentation

model2sparse: Converts a niche model into a diagonal sparse matrix

Description

model2sparse: Converts a niche model into a diagonal sparse matrix

Usage

model2sparse(model, threshold = NULL)

Arguments

model

A raster object representing the geographic projection of a niche model.

threshold

A threshold to convert a continuous model into a binary model.

Value

A diagonal sparse matrix representing the geographic projection of a niche model.

Examples

## Not run: 
model_path <- system.file("extdata/Lepus_californicus_cont.tif",
                          package = "bam")
model <- raster::raster(model_path)

sparse_mod <- bam::model2sparse(model, threshold=0.05)

## End(Not run)

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