partial_roc: Partial ROC calculation for ecological niche models

View source: R/partial_roc.R

partial_rocR Documentation

Partial ROC calculation for ecological niche models

Description

partial_roc applies partial ROC tests to model predictions.

Usage

partial_roc(prediction, test_data, longitude, latitude, error = 5,
            iterations = 500, percentage = 50)

Arguments

prediction

RasterLayer or numeric vector of ecological niche model predictions to be evaluated. If RasterLayer, layer of predicted suitability. If numeric vector, predicted suitability values.

test_data

matrix, data.frame, or numeric vector containing coordinates of occurrences to test model predictions to be evaluated. If matrix or data.frame, columns must include longitude and latitude to extract values of raster prediction. If numeric, values of suitability in such occurrences. If a matrix or a data.frame is provided, prediction must be a RasterLayer.

longitude

(character) name of the column with longitude data.

latitude

(character) name of the column with latitude data.

error

(numeric) value from 0 to 100 to represent the percentage of potential error (E) that the data could have due to any source of uncertainty. Default = 5.

iterations

(numeric) number of bootstrap iterations to be performed; default = 500.

percentage

(numeric) percentage of testing data to be used in each bootstrapped process for calculating the partial ROC. Default = 50.

Details

Partial ROC is calculated following Peterson et al. (2008; http://dx.doi.org/10.1016/j.ecolmodel.2007.11.008).

Value

A list with the summary of the results and a data.frame containing the AUC values and AUC ratios calculated for all iterations.

Examples

occurrences <- read.csv(system.file("extdata", "occurrences.csv",
                        package = "ellipsenm"))
prediction <- raster::raster(system.file("extdata", "prediction.tif",
                                      package = "ellipsenm"))

p_roc <- partial_roc(prediction = prediction, test_data = occurrences,
                     longitude = "Longitude", latitude = "Latitude")

marlonecobos/ellipsenm documentation built on Oct. 18, 2023, 8:09 a.m.