# Perfect agreement (1 and 2 are just switched)
actual <- c(2, 2, 1, 3, 2, NA)
predicted <- c(1, 1, 2, 3, 1, NA)
agreement(actual, predicted)
# No agreement
predicted <- sample(predicted)
agreement(actual, predicted)
Run the code above in your browser using DataLab