heterog {heterogen} | R Documentation |
Heterogeneity (rasters)
Description
The heterog
function is designed to calculate environmental heterogeneity metric from a raster stack dataset.
This function aids in assessing the spatial variation and diversity of environmental variables within the raster data,
providing valuable insights into the heterogeneity of the study area.
Usage
heterog(
datastack,
bandwidth = 0.3,
tolerance = 5,
nprocess = 1000,
parallel = FALSE,
ncores = 2,
normalized = FALSE,
method = "iter",
dirds = "rds"
)
Arguments
datastack |
|
bandwidth |
The bandwidth for the spatial weighting function. |
tolerance |
The tolerance for spatial weight computation. |
nprocess |
(Optional) The number of iterations for calculating the principal components. Default is set to 1000. |
parallel |
(Optional) A logical value indicating whether to run the computation in parallel. If |
ncores |
(Optional) The number of cores to be used for parallel computation. Only applicable if |
normalized |
(Optional) A logical value indicating whether the input data should be normalized before performing GWPCA. Default is |
method |
The method used for GWPCA computation. It can take one of the following values. |
dirds |
(Optional) The directory where the results will be saved in RDS format. Default is |
Value
A SpatHetero object
hetero A heterogeneity layer
matrix A Matrix of eigenvalues
rasters A complete set of heterogeneity layers for each component
Examples
# Case 01: South
path <- system.file("extdata","south", package="heterogen")
south_rast <- terra::rast(list.files(path, full.names = TRUE,
pattern = '.tif'))
south_het <- heterog(south_rast, parallel = TRUE,
bandwidth = 0.1, tolerance = 10)
plot(south_het)
# Case 02: North
path <- system.file("extdata","north", package="heterogen")
north_rast <- terra::rast(list.files(path, full.names = TRUE,
pattern = '.tif'))
north_het <- heterog(north_rast, parallel = TRUE,
bandwidth = 0.1, tolerance = 10)
plot(north_het)