overlap_null_distrib {BoundaryStats} | R Documentation |
Null distribution for boundary overlap statistics
Description
Creates custom probability distributions for three boundary overlap statistics (directly overlapping boundary elements, minimum distance between boundary elements in x to y, and minimum distance between elements in x and y). Given two SpatRaster objects with the same extent, projection, and resolution, simulates n iterations of random raster surfaces from neutral model(s).
Usage
overlap_null_distrib(
x,
y,
rand_both,
x_convert = FALSE,
y_convert = FALSE,
x_cat = FALSE,
y_cat = FALSE,
threshold = 0.2,
n_iterations = 10,
x_model = "random",
y_model = "random",
px = 0.5,
py = 0.5,
progress = TRUE
)
Arguments
x |
A SpatRaster object. If rand_both = FALSE, only this raster will be modeled. |
y |
A SpatRaster object. If rand_both = FALSE, this raster does not change. |
rand_both |
TRUE if distribution of traits in x and y should be modeled. |
x_convert |
TRUE if x contains numeric trait data that needs to be converted to boundary intensities. default = FALSE. |
y_convert |
TRUE if y contains numeric trait data that needs to be converted to boundary intensities. default = FALSE. |
x_cat |
TRUE if x contains a categorical variable. default = FALSE. |
y_cat |
TRUE if y contains a categorical variable. default = FALSE. |
threshold |
A value between 0 and 1. The proportion of cells to keep as boundary elements. Default = 0.2. |
n_iterations |
An integer indicating the number of iterations for the function. A value of 100 or 1000 is recommended to produce sufficient resolution for downstream statistical tests. default = 10. |
x_model |
Neutral model to use. Options: 'random' (stochastic), 'gaussian' (Gaussian random field), and 'random_cluster' (modified random clusters method) |
y_model |
Neutral model to use for y. |
px |
If using modified random clusters for x, proportion of cells to be marked in percolated raster. Higher values of p produce larger clusters. Default = 0.5 |
py |
If using modified random clusters for y, proportion of cells to be marked in percolated raster. Higher values of p produce larger clusters. Default = 0.5 |
progress |
If progress = TRUE (default) a progress bar will be displayed. |
Value
A list of probability distribution functions for boundary overlap statistics.
Author(s)
Amy Luo
References
Saura, S. & Martínez-Millán, J. (2000). Landscape patterns simulation with a modified random clusters method. Landscape Ecology, 15:661-678.
Examples
data(T.cristatus)
T.cristatus <- terra::rast(T.cristatus_matrix, crs = T.cristatus_crs)
terra::ext(T.cristatus) <- T.cristatus_ext
data(grassland)
grassland <- terra::rast(grassland_matrix, crs = grassland_crs)
terra::ext(grassland) <- grassland_ext
Tcrist_ovlp_null <- overlap_null_distrib(T.cristatus, grassland, rand_both = FALSE,
x_cat = TRUE, n_iterations = 100, x_model = 'random_cluster')