model2sparse {bamm} | R Documentation |
model2sparse: Converts a niche model into a diagonal sparse matrix
model2sparse(model, threshold = NULL)
model |
A raster object representing the geographic projection of a niche model. |
threshold |
A threshold to convert a continuous model into a binary model. |
threshold parameter represents the suitability value used to convert continuous model into a binary model.
An object of class setA
. The niche model
is stored as diagonal sparse matrix (slot sparse_model).
Luis Osorio-Olvera & Jorge SoberĂ³n
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)