If comparison and reference (raster) maps are provided, this function creates the Overall Sources plot from the comparison between the comparison map (or map at time t) and the reference map (or map at time t+1). If a square contingency table (matrix) is provided instead of raster maps, then this function creates the Overall Sources plot from the comparison between the comparison variable (or variable at time t) and the reference variable (or variable at time t+1).
overallSourcesPlot(comp = NULL, ref = NULL, ctmatrix = NULL, analysis = "error",
units = NULL, population = NULL, fontSize = NULL, colorValues = NULL,
breaks = waiver(), labels = waiver(), limits = NULL)
a stacked barplot showing the omission and comission components of difference between the comparison map/variable (or map/variable at time t) and the reference map/variable (or map/variable at time t+1)
object of class RasterLayer corresponding to a comparison map (or map at time t). See Details below
object of class RasterLayer corresponding to a reference map (or map at time t+1). See Details below
matrix representing a square contingency table between a comparison variable (rows) and a reference variable (columns). See Details below
character string indicating type of analysis, either "error" (default) or "change"
character string indicating units of ctmatrix
an n x 2 matrix provided to correct the sample count to population count in the square contingency table. See Details below
text size (in pts)
a set of aesthetic values to map data values to. If this is a named vector, then the values will be matched based on the names. If unnamed, values will be matched in order (usually alphabetical) with the limits of the scale. Any data values that don't match will be given na.value
.
One of:
NULL
for no breaks
waiver()
for the default breaks computed by the
transformation object
A numeric vector of positions
A function that takes the limits as input and returns breaks as output
One of:
NULL
for no labels
waiver()
for the default labels computed by the
transformation object
A character vector giving labels (must be same length as breaks
)
A function that takes the breaks as input and returns labels as output
A numeric vector of length two providing limits of the scale.
Use NA
to refer to the existing minimum or maximum.
Users may enter as input either a square contingency table (ctmatrix
) or a comparison and a reference raster maps (comp
and ref
, respectively).
The first column of population
must contain integer identifiers of each category, corresponding to the categories in the comparison and reference variables. The second column corresponds to the population totals for each category.
Pontius Jr., R.G., Millones, M. 2011. Death to Kappa: birth of quantity disagreement and allocation disagreement for accuracy assessment. International Journal of Remote Sensing 32 (15), 4407-4429.
differenceMetrics
comp <- raster(system.file("external/comparison.rst", package="diffeR"))
ref <- raster(system.file("external/reference.rst", package="diffeR"))
overallSourcesPlot(comp, ref)
ctmat <- crosstabm(comp, ref)
overallSourcesPlot(ctmatrix = ctmat, units = "pixels")
Run the code above in your browser using DataLab