model_path <- system.file("extdata/Lepus_californicus_cont.tif",
package = "bamm")
model <- raster::raster(model_path)
sparse_mod <- bamm::model2sparse(model,threshold=0.05)
occs_lep_cal <- data.frame(longitude = c(-115.10417,
-104.90417),
latitude = c(29.61846,
29.81846))
occs_sparse <- bamm::occs2sparse(modelsparse = sparse_mod,
occs = occs_lep_cal)
head(occs_sparse)
Run the code above in your browser using DataLab