R/CADJ.R

Defines functions CADJ

CADJ <-function(X){
  J <- colnames(X)
  K <- ncol(X)
  CADJ.mat<-matrix(0,nrow=K,ncol=K,dimnames=list(J,J))
  for (i in 1:K) for(j in 1:K) CADJ.mat[i,j] <- sum(X[,i]*X[,j]) / sum(X[,j])
  diag(CADJ.mat) <- NA
  return(CADJ.mat)
}

Try the mudfold package in your browser

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

mudfold documentation built on Nov. 24, 2022, 5:09 p.m.