R/OrderHypotheses.r

Defines functions OrderHypotheses

Documented in OrderHypotheses

#' @title order hypotheses
#' @description
#' Ranks the hypotheses.  Takes a matrix containing the scores for each node of the network, and ranks them placing the hypothesis with the 
#' most correct predictions is at the top

#' @param scoresMatrix a matrix containing the scores for each node of the network
#' @return a ranked table of hypotheses

OrderHypotheses <- function(scoresMatrix) {
    
    tableOfScores <- as.table(scoresMatrix)
    # Order in descending order
    orderedTable <- tableOfScores[order(-1 * (as.numeric(tableOfScores[, 3]))), ]
    
    return(orderedTable)
} 

Try the CausalR package in your browser

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

CausalR documentation built on Nov. 8, 2020, 5:25 p.m.