Function to binarize a continuos model given a threshold

bin_model(model, occs, percent)

Arguments

model

A continuos raster model of suitability values

occs

Ocurrence data with two colomuns (longitude and latitude).

percent

Type of thresholding method. Values go from 0-100 percent of the data. 0 is equivalent to the minimum training presence.

Value

A binary map of the prediction.

Examples

if (FALSE) { model_p <- system.file("extdata/ambystoma_model.tif", package = "ntbox") model <- raster::raster(model_p) data_p <- system.file("extdata/ambystoma_validation.csv", package = "ntbox") data <- read.csv(data_p) occs <- data[which(data$presence_absence==1),] binary <- bin_model(model,occs,percent = 5) raster::plot(binary) }