Learn R Programming

raster (version 1.5-8)

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. Choose from "text", "window", or "" (the default, no progress bar)

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 DataLab