omission_rate: Compute omission rate of a model

View source: R/omission_rate.R

omission_rateR Documentation

Compute omission rate of a model

Description

Computes the omission rate value of a model given a threshold

Usage

omission_rate(model, threshold, occ_train, occ_test)

Arguments

model

Ecological niche model in raster format.

threshold

A numeric vector with the thresholds that will be used to compute the omission rates.

occ_train

Train data with three columns: "sp_name", "longitude" and "latitude"

occ_test

Test data with three columns: "sp_name", "longitude" and "latitude"

Value

Returns a data.frame with the threshold value, the corresponding suiitability value at that thereshold and the omission rate.

Examples

## Not run: 
# Occurrence data for the giant hummingbird (Patagona gigas)
pg <- utils::read.csv(system.file("extdata/p_gigas.csv",
                                  package = "ntbox"))
# Split occs in train and test
pgL <- base::split(pg,pg$type)
pg_train <- pgL$train[,-4]
pg_test <- pgL$test[,-4]
mod_path <- file.path(system.file("extdata",
                            package = "ntbox"),
                     "p_gigas.tif")
model <- raster::raster(mod_path)
thresholds <- seq(0.01, 0.1,by = 0.03)
omrs <- omission_rate(model = model,
                      threshold = thresholds,
                      occ_train = pg_train,
                      occ_test = pg_test)

print(omrs)

## End(Not run)

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