Description Usage Arguments Value Author(s) See Also Examples
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.
1 2 3 | CompareClassification(x,
y, names = NULL,
samplefrac = 1)
|
x |
First raster layer with classification. |
y |
Second raster layer with classification. |
names |
a list with |
samplefrac |
fraction of grid cells to be sampled from both rasters in order to calculate the contingency table |
The function returns a list of class "CompareClassification" with the following components:
raster
a raster layer indicating the agreement of the two classifications.
table
a contingency table with user, producer and total accuracies. Rows in the table correpond to the classification x
, columns to the classifcation y
.
kappa
Kappa
coefficient.
Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]
plot.CompareClassification
, AccuracyAssessment
, TrendClassification
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.