Learn R Programming

raster (version 2.0-05)

freq: Frequency table

Description

Frequency table of the values of a RasterLayer.

Usage

## S3 method for class 'RasterLayer':
freq(x, digits=0, useNA='ifany', progress='', ...)

Arguments

x
RasterLayer
digits
Non-negative integer for rounding the cell values. Argument is passed to round
useNA
Character. What to do with NA values? Options are "no", "ifany", "always". See to table
progress
Character to specify a progres bar. Choose from 'text', 'window', or '' (the default, no progress bar)
...
Additional arguments (none implemented)

Value

  • matrix

See Also

count, crosstab and zonal

Examples

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

Run the code above in your browser using DataLab