model2sparse {bamm} | R 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. |
Details
threshold parameter represents the suitability value used to convert continuous model into a binary model.
Value
An object of class setA
. The niche model
is stored as diagonal sparse matrix (slot sparse_model).
Author(s)
Luis Osorio-Olvera & Jorge SoberĂ³n
Examples
model_path <- system.file("extdata/Lepus_californicus_cont.tif",
package = "bamm")
model <- raster::raster(model_path)
sparse_mod <- bamm::model2sparse(model, threshold=0.75)
print(sparse_mod)
raster::plot(sparse_mod@niche_model)
[Package bamm version 0.5.0 Index]