Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rasterEntropy

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

Tools for Remote Sensing Data Analysis

v0.2.6
GPL (>= 3)
Authors
Benjamin Leutner [cre, aut], Ned Horning [aut], Jakob Schwalb-Willmann [aut], Robert J. Hijmans [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.