Description Usage Arguments Details Value Examples
Computes the Lacunarity of a Spatial Raster object or a list of Spatial Raster objects.
1 2 3 4 5 6 7 8 9 10 |
x |
SpatRaster or list of SpatRaster OR character; Raster image that can be loaded using |
box |
character; Either SQUARE for a square neighborhood window, or CIRCLE for a round neighborhood window |
r_vec |
integer vector (optional); Vector of box diameter values. Every r must be odd and >2. It is recommended that no r value is greated than half of the shorter dimension of x. If r_vec is NULL (default), r_vec will be generated automatically |
r_max |
integer (optional); Maximum value of r, r_vec will be cut off for values >r |
plot |
logical; Should the summary Lacunarity figure, showing Lacunarity of all SpatRasters be printed? |
save_plot |
FALSE or folder path; If not FALSE, a folder path to save Lacunarity plots (see details) |
progress |
logical; Show progress bar? |
ncores |
numeric; The number of cores to use |
lacunarity
is based on the algorithm for binary images provided by Plotnick et al. 1993.
Hoechstetter et al. 2011 further applyed this algorithm on continuous raster images.
If x
is a binary raster (e.g. Land Use) Lacunarity is beening calculated using the Plotnicks algorithm.
tibble
containing all Lacunarity values: name
and i
refer to the name and index of the raster input.
x
is the box diameter (a 5X5 box has a diameter of 5 with a radius of 2). lac
indicates the Lacunarity value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Create a SpatRast as input
mat_sample <- matrix(data = c(
1,1,0,1,1,1,0,1,0,1,1,0,
0,0,0,0,0,1,0,0,0,1,1,1,
0,1,0,1,1,1,1,1,0,1,1,0,
1,0,1,1,1,0,0,0,0,0,0,0,
1,1,0,1,0,1,0,0,1,1,0,0,
0,1,0,1,1,0,0,1,0,0,1,0,
0,0,0,0,0,1,1,1,1,1,1,1,
0,1,1,0,0,0,1,1,1,1,0,0,
0,1,1,1,0,1,1,0,1,0,0,1,
0,1,0,0,0,0,0,0,0,1,1,1,
0,1,0,1,1,1,0,1,1,0,1,0,
0,1,0,0,0,1,0,1,1,1,0,1
), nrow = 12, ncol = 12, byrow = TRUE
)
x <- terra::rast(mat_sample)
lacunarity(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.