R/snlK.R

Defines functions snlK

snlK <- function(B){
  
  D <- matrix(rep(0,nrow(B)*ncol(B)), nrow=nrow(B))
  
  for(ii in 1:max(nrow(B),ncol(B))){
    for(jj in 1:max(nrow(B),ncol(B))){
      D[ii,jj] <- B[ii,ii] + B[jj,jj] - 2*B[ii,jj]
    }
  }
  
  return(D)
}

Try the Datasmith package in your browser

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

Datasmith documentation built on May 29, 2017, 10:19 p.m.