R/RandIndex.R

Defines functions RandIndex

RandIndex <- function(x, y){
  
  n <- length(x)
  adjx <- AdjacencyMatrix(x)
  adjy <- AdjacencyMatrix(y)
  diff <- adjx - adjy	
  disgree <- length(diff[diff==1])
  RD <- 1 - disgree/(n*(n-1))
  return(round(RD, 2))
  
}
ChenMengjie/Citrus documentation built on April 14, 2020, 4:55 a.m.