rasterEntropy: Multi-layer Pixel Entropy

View source: R/rasterEntropy.R

rasterEntropyR 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

RasterStack or RasterBrick

...

additional arguments passed to writeRaster

Details

Entropy is calculated as -sum(p log(p)); p being the class frequency per pixel.

Value

RasterLayer "entropy"

Examples

data(rlogo)
re <- rasterEntropy(rlogo)
ggR(re, geom_raster = TRUE)

RStoolbox documentation built on March 18, 2022, 5:37 p.m.