raster (version 1.0.4)

crosstab: Cross-tabulate

Description

Cross-tabulate two RasterLayer objects to create a contingency table.

Usage

crosstab(x, y, ...)

Arguments

x
A RasterLayer object
y
A RasterLayer object
...
Additional arguments. See Details

Value

  • A table

Details

A full call to the crosstab method for a RasterLayer is: crosstab(x, y, digits=0, progress) rll{ digits Integer. The number of digits for rounding the values before cross-tabulation progress Character. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

See Also

freq, zonal

Examples

Run this code
r <- raster()
r[] = runif(ncell(r)) * 5
s = setValues(r, runif(ncell(r)) * 10)
crosstab(r,s)

Run the code above in your browser using DataLab