| occs2sparse | R Documentation | 
occs2sparse: Converts occurrence data into a sparse matrix object
occs2sparse(modelsparse, occs)
| modelsparse | A setA object returned by the function  | 
| occs | A matrix or a data.frame containing two columns. The first one is the longitude and the second is the latitude. | 
A sparse vector of zeros and ones.
## 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)
occs_lep_cal <- data.frame(longitude = c(-115.10417,
                                         -104.90417),
                           latitude = c(29.61846,
                                        29.81846))
occs_sparse <- bam::occs2sparse(modelsparse = sparse_mod,
                                occs = occs_lep_cal)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.