algorithm_metrics {SESraster} | R Documentation |
Performance of randomization algorithms
Description
Compares the richness and occurrence incidence across species between actual and randomized species distributions
Usage
algorithm_metrics(
x,
spat_alg = NULL,
spat_alg_args = NULL,
aleats = 10,
filename = "",
force_wr_aleat_file = FALSE,
...
)
Arguments
x |
SpatRaster. A SpatRaster containing presence-absence data (0 or 1) for a set of species. |
spat_alg |
A function with the algorithm implementing the desired
randomization method. It must work with SpatRaster objects. See examples.
Example of functions that work are: |
spat_alg_args |
List of arguments passed to the randomization method
chosen in 'spat_alg'. See |
aleats |
positive integer. A positive integer indicating how many times the calculation should be repeated. |
filename |
character. Output filename |
force_wr_aleat_file |
logical. Force writing bootstrapped rasters, even if files fit in memory. Mostly used for internal test units. |
... |
additional arguments passed to 'terra::app()' function. |
Value
a list with two components:
spp_metrics: a matrix with metrics comparing actual and randomized frequency of species occurrence. Metrics are average, sd, min, and max frequency across randomizations, sp_reldiff (average difference relative to species frequency), global_reldiff (average difference relative to the number of available cells), upper and lower confidence intervals for sp_reldiff and global_reldiff.
spat_rich_diff: a SpatRaster with summary statistics about differences between actual and bootstrapped site (cell) richness
Author(s)
Neander M. Heming
See Also
bootspat_str
, bootspat_naive
,
bootspat_ff
, SESraster
, plot_alg_metrics
Examples
library(SESraster)
library(terra)
r <- load_ext_data()
algorithm_metrics(r, spat_alg = "bootspat_naive", spat_alg_args=list(random="species"), aleats = 3)
algorithm_metrics(r, spat_alg = "bootspat_naive", spat_alg_args=list(random="site"), aleats = 3)
# algorithm_metrics(r, spat_alg = "bootspat_naive", spat_alg_args=list(random="both"))