# NOT RUN {
require(raster)
r <- raster(ncols=100, nrows=100)
r[] <- round(runif(ncell(r), 1,8), digits=0)
rEnt <- raster.entropy(r, d=5, categorical = TRUE, global = TRUE)
opar <- par
par(mfcol=c(2,1))
plot(r)
plot(rEnt)
par(opar)
# }
Run the code above in your browser using DataLab