Determine the accuracy of your landcover map

step 1: Install R on your computer

step 2: install the e1071 package in R.

install.packages("e1071")

Step 3: Use the confusion matrix algorithm as shown below.

library("e1071")

# your reference data
reference =  as.factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4))
# values from your land cover map
prediction = as.factor(c(1,1,3,1,2,4,2,2,3,1,3,3,4,2,4,4))


# get the confusion table
confusionMatrix(prediction, reference, positive = NULL, dnn = c("Prediction", "Reference"))
Advertisements