raster (version 1.0.4)

count: Count

Description

Count the frequency of a single value in a RasterLayer.

Usage

count(raster, value, digits=0, progress)

Arguments

raster
A RasterLayer
value
The value to be counted
digits
the number of digits for rounding the values
progress
Character. Optional. Can be "text", "tcltk", "windows" (on that platform only) and ""

Value

  • numeric

See Also

freq

Examples

Run this code
r <- raster(nrow=18, ncol=36)
r[] <- runif(ncell(r))
r <- r * r * r * 10
count(r, 5)

Run the code above in your browser using DataCamp Workspace