cl1 <- c(1, 1, 1, 2, 2, 2, 2, 2)
cl2 <- c(1, 2, 1, 2, 1, 2, 1, 3)
adjustedRand(cl1, cl2)
# perfect agreement
cl1 <- c(1, 1, 2, 2)
cl2 <- cl1
adjustedRand(cl1, cl2)
# Ruspini data
data(Ruspini)
ruspini <- Ruspini$ruspini
# cluster membership
ruspini.mem <- Ruspini$ruspini.mem
# partition by clues
cl2 <- clues(ruspini, quiet = TRUE)$mem
adjustedRand(ruspini.mem, cl2)
Run the code above in your browser using DataLab