View source: R/rasterEntropy.R
rasterEntropy | R Documentation |
Shannon entropy is calculated for each pixel based on it's layer values. To be used with categorical / integer valued rasters.
rasterEntropy(img, ...)
img |
SpatRaster |
... |
additional arguments passed to writeRaster |
Entropy is calculated as -sum(p log(p)); p being the class frequency per pixel.
SpatRaster "entropy"
re <- rasterEntropy(rlogo)
ggR(re, geom_raster = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.