R/transReduct.R

Defines functions transReduct

Documented in transReduct

transReduct <- function(e) {
  stopifnot(is.matrix(e))
  stopifnot(nrow(e) == ncol(e))
  stopifnot(!is.na(e))
  stopifnot(e >= 0)

  e <- ifelse(e > 0, 1, 0)
  transitivity <- ifelse(e %*% e > 0, 1, 0)
  return(e - transitivity)
}

Try the paircompviz package in your browser

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

paircompviz documentation built on Nov. 8, 2020, 6:26 p.m.