Learn R Programming

raster (version 2.0-05)

count: Count

Description

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

Usage

## S3 method for class 'Raster':
count(x, value, digits=0, progress='', ...)

Arguments

x
Raster* object
value
The value to be counted, can be a number, a logical value, or NA
digits
Non-negative integer. The number of digits for rounding the values, default is 0, i.e. numbers are compared as integers
progress
Character to specify a progres bar. Choose from 'text', 'window', or '' (the default, no progress bar)
...
Additional arguments. None implemented

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