R/validate.partialorder.incidence.R

Defines functions validate.partialorder.incidence

Documented in validate.partialorder.incidence

validate.partialorder.incidence <-
function(m)  {
    warn <- NULL
    #if(!is.partialorder(m)) stop("not an incidence martix")
    if(!binary(m)) warn <- c(warn, "binary\n")
    if(!antisymmetry(m)) warn <- c(warn, "antisymmetric\n")
    if(!reflexivity(m)) warn <- c(warn, "reflexive\n")
    if(!transitivity(m)) warn <- c(warn, "transitive\n")
    if(!is.null(warn)) stop("the matrix is not:\n", warn)
    if (is.null(dimnames(m))) dimnames(m) <- list(1:nrow(m), 1:ncol(m))
    class(m) <- "incidence"
    return(m)
}

Try the parsec package in your browser

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

parsec documentation built on Aug. 19, 2023, 5:07 p.m.