Learn R Programming

raster (version 1.8-3)

count: Count

Description

Count the frequency of a single value in a Raster object.

Usage

count(x, value, ...)

Arguments

x
A Raster* object
value
The value to be counted, can be a number or a logical or NA
...
Additional arugments: digits, the number of digits for rounding the values, default is 0, i.e. numbers are compared as integers.

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