composite: create a composite matrix

compositeR Documentation

create a composite matrix

Description

provide a method to create a composite matrix from the crosstabulation of a comparison map (or map at time t) and a reference map (or map at time t+1), both aggregated at a given factor

Usage

composite(comp, ref, factor)

Arguments

comp

object of class SpatRaster corresponding to a comparison map (or map at time t)

ref

object of class SpatRaster corresponding to a reference map (or map at time t+1)

factor

integer. Aggregation factor expressed as number of cells in each direction (horizontally and vertically). Or two integers (horizontal and vertical aggregation factor). See aggregate() in the terra package for details

Details

the pixel definition in a composite matrix interpretes class membership as the proportion of a pixel that belongs to a class. The pixel contains information about only the quantity of each category (Kuzera and Pontius 2008).

Value

a matrix showing the contingency table derived from the crosstabulation of a comparison map (or map at time t) and a reference map (or map at time t+1), both aggregated at a given factor. Output values are given as proportion (0 to 1)

References

Kuzera, K., Pontius Jr., R.G. 2008. Importance of matrix construction for multiple-resolution categorical map comparison. GIScience & Remote Sensing 45 (3), 249-274.

See Also

memberships

Examples

comp <- rast(system.file("external/comparison.rst", package = "diffeR"))
ref <- rast(system.file("external/reference.rst", package = "diffeR"))
composite(comp, ref, factor = 2)

amsantac/diffeR documentation built on Oct. 14, 2023, 12:58 a.m.