CompareClassification: Compare two classification maps

Description Usage Arguments Value Author(s) See Also Examples

Description

This function computes an agreement map of two classifications (RasterLayers with classified values). Additionally, it computes a frequency table with user, producer and total accuracies as well as the Kappa coefficient.

Usage

1
2
3
CompareClassification(x, 
    y, names = NULL, 
    samplefrac = 1)

Arguments

x

First raster layer with classification.

y

Second raster layer with classification.

names

a list with names of the two classifications and class names. See example section for details.

samplefrac

fraction of grid cells to be sampled from both rasters in order to calculate the contingency table

Value

The function returns a list of class "CompareClassification" with the following components:

Author(s)

Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]

See Also

plot.CompareClassification, AccuracyAssessment, TrendClassification

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Calculate NDVI trends from two methods and compare the significant trends

# # calculate trends with two different methods
# AATmap <- TrendRaster(ndvimap, start=c(1982, 1), freq=12, method="AAT", breaks=0)
# plot(AATmap)
# STMmap <- TrendRaster(ndvimap, start=c(1982, 1), freq=12, method="STM", breaks=0)
# plot(STMmap)
# 
# # classify the trend estimates from the two methods into significant 
# # positive, negative and no trend
# AATmap.cl <- TrendClassification(AATmap)
# plot(AATmap.cl, col=brgr.colors(3))
# STMmap.cl <- TrendClassification(STMmap)
# plot(STMmap.cl, col=brgr.colors(3))
# 
# # compare the two classifications
# compare <- CompareClassification(x=AATmap.cl, y=STMmap.cl, 
#    names=list('AAT'=c("Br", "No", "Gr"), 'STM'=c("Br", "No", "Gr")))
# compare
# 
# # plot the comparison
# plot(compare)

greenbrown documentation built on Dec. 18, 2020, 3:02 p.m.