kuenm_mop: Extrapolation risk analysis for single comparisons

View source: R/kuenm_mop.R

kuenm_mopR Documentation

Extrapolation risk analysis for single comparisons

Description

kuenm_mop calculates a mobility-oriented parity layer by comparing environmental values between the calibration area and the area or scenario to which an ecological niche model is transferred.

Usage

kuenm_mop(M.variables, G.stack, percent = 10, comp.each = 2000,
          parallel = FALSE, n.cores = NULL)

Arguments

M.variables

a RasterStack of variables or a matrix with variables as columns representing the calibration area. If matrix, columns must contain only information for the variables to be used.

G.stack

a RasterStack of variables representing the full area of interest, and areas or scenarios to which models are transferred.

percent

(numeric) percent of values sampled from te calibration region to calculate the MOP.

comp.each

(numeric) compute distance matrix for a each fixed number of rows (default = 2000).

parallel

(logical) if TRUE, calculations will be performed in parallel using n.cores of the computer. This will demand more RAM and almost full use of the CPU; hence, its use is more recommended in high-performance computers. Using this option will speed up the analyses. Default = FALSE.

n.cores

(numeric) number of cores to be used in parallel processing. Default = NULL, in which case all CPU cores on current host - 1 will be used.

Details

The MOP is calculated following Owens et al. (2013; https://doi.org/10.1016/j.ecolmodel.2013.04.011). This function is a modification of the MOP funcion, available at https://github.com/narayanibarve/ENMGadgets.

Value

A mobility-oriented parity RasterLayer where values of 0 represent strict extrapolation, which means complete dissimilarity of environments between the calibration (M) or the background, and the projection area (G).

Examples

mvars <- raster::stack(list.files(system.file("extdata", package = "kuenm"),
                                  pattern = "Mbio_", full.names = TRUE))
gvars <- raster::stack(list.files(system.file("extdata", package = "kuenm"),
                                  pattern = "Gbio_", full.names = TRUE))
names(mvars) <- gsub("M", "", names(mvars))
names(gvars) <- names(mvars)

perc <- 5

mop <- kuenm_mop(M.variables = mvars, G.stack = gvars, percent = perc)

manubio13/ku.enm documentation built on Jan. 5, 2024, 5:55 a.m.