R/memb.cluster.R

Defines functions memb.cluster

memb.cluster = function(memb){
  n = length(memb)
  capgfl.matrix = matrix(0,n,n)
  for(i in 1:(n-1)){
    for (j in (i+1):(n)) {
      capgfl.matrix[i,j] <- as.numeric(memb[i] == memb[j])
    }
  }
  capgfl.matrix2 = capgfl.matrix+t(capgfl.matrix); diag(capgfl.matrix2)=1
  return(capgfl.matrix2)
}

Try the cencrne package in your browser

Any scripts or data that you put into this service are public.

cencrne documentation built on Jan. 9, 2023, 5:10 p.m.