Learn R Programming

spatialEco (version 0.1-5)

raster.entropy: Raster Entropy

Description

Calculates entropy on integer raster (i.e., 8 bit 0-255)

Usage

raster.entropy(x, d = 5, filename = FALSE, ...)

Arguments

x
object of class raster (requires integer raster)
d
Size of matrix (window)
filename
Raster file written to disk
...
Optional arguments passed to writeRaster or dataType

Value

raster class object or specified format raster written to disk

References

Fuchs M., Hoffmann R., Schwonke F. (2008) Change Detection with GRASS GIS - Comparison of images taken by different sensor. On line at: http://geoinformatics.fsv.cvut.cz/gwiki/Change_Detection_with_GRASS_GIS_-_Comparison_of_images_taken_by_different_sensors

Examples

Run this code
require(raster)
  r <- raster(ncols=100, nrows=100)
    r[] <- round(runif(ncell(r), 1,8), digits=0)

rEnt <- raster.entropy(r, d=5)
  opar <- par  
    par(mfcol=c(2,1))
      plot(r)
        plot(rEnt)
  par(opar)

Run the code above in your browser using DataLab