R/reduce_transitivity.R

Defines functions .reduce_transitivity

.reduce_transitivity <- function(M) {

  D <- Matrix::Diagonal(n = ncol(M))
  adj <- M - D
  transitivity <- adj %*% adj
  transitivity@x[transitivity@x > 0] <- 1

  return(adj - transitivity)

}

Try the fcaR package in your browser

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

fcaR documentation built on June 29, 2021, 1:06 a.m.