bin_model: bin_model: Binarize a model using a threshold

View source: R/bin_model.R

bin_modelR Documentation

bin_model: Binarize a model using a threshold

Description

Function to binarize a continuos model given a threshold

Usage

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

## Not run: 

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)

## End(Not run)

luismurao/ntbox documentation built on May 9, 2024, 8:24 p.m.