rasterEntropy {RStoolbox} | R Documentation |
Multi-layer Pixel Entropy
Description
Shannon entropy is calculated for each pixel based on it's layer values. To be used with categorical / integer valued rasters.
Usage
rasterEntropy(img, ...)
Arguments
img |
SpatRaster |
... |
additional arguments passed to writeRaster |
Details
Entropy is calculated as -sum(p log(p)); p being the class frequency per pixel.
Value
SpatRaster "entropy"
Examples
re <- rasterEntropy(rlogo)
ggR(re, geom_raster = TRUE)
[Package RStoolbox version 1.0.0 Index]