cdlTools (version 0.15)

matchCount: Counts distinct pixel pairs in CDL raster images

Description

matchCount counts distinct pixel pairs for CDL raster images with same extents and resolution.

Usage

matchCount(x, y, m = 256)

Value

A matrix with pixel counts by unique ordered CDL crop pairs in x and y.

Arguments

x

A CDL raster image.

y

A CDL raster image.

m

A bound for the max enumeration of CDL categories. The default is 256.

Author

Jonathan Lisic, jlisic@gmail.com

Examples

Run this code
if (FALSE) {
z1 <- matrix( rep(c(1,4),8), nrow=4) 
z2 <- matrix( rep(c(1:4),4), nrow=4) 

r1 <- raster(z1)
r2 <- raster(z2)

a <- matchCount(r1,r2)
}

Run the code above in your browser using DataCamp Workspace