Check if two partitions are equivalent, i.e. represent the same clustering.
Usage
equivalent_partitions(partition1, partition2)
Arguments
- partition1, partition2
two non-empty vectors representing.
partitions to be compared
Value
TRUE
if both partitions are equivalent, FALSE
otherwise.
Examples
p1 <- c(2, 4, 3)
p2 <- c("yes", "no", "maybe")
equivalent_partitions(p1, p2) # TRUE
#> [1] TRUE
p3 <- c(2, 4, 3)
p4 <- c("yes", "no", "no")
equivalent_partitions(p3, p4) # FALSE
#> [1] FALSE