R/transitive.reduction.R

Defines functions transitive_reduction

Documented in transitive_reduction

#' @title Transitive Reduction
#' @description  Calculates the transitive reduction of a partial ranking.
#'
#' @param P A partial ranking as matrix object calculated with [neighborhood_inclusion]
#'    or [positional_dominance].
#' @return transitive reduction of `P`
#' @author David Schoch
#' @examples
#' library(igraph)
#'
#' g <- threshold_graph(100, 0.1)
#' P <- neighborhood_inclusion(g)
#' sum(P)
#'
#' R <- transitive_reduction(P)
#' sum(R)
#' @export
transitive_reduction <- function(P) {
  B <- transreduct(as.matrix(P))
  return(B)
}

Try the netrankr package in your browser

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

netrankr documentation built on Dec. 21, 2021, 5:07 p.m.