R/partMat2clustVec.R

Defines functions partMat2clustVec

Documented in partMat2clustVec

partMat2clustVec <- function(U, skipValidity = FALSE) {
    M = ncol(U)
    C = rep(0, M)

    if (!skipValidity && !isValidBPM(U)) {
        stop("Invalid binary partition matrix U.")
    }

    for (i in 1:M) {
        if (any(U[, i])) {
            C[i] = which(U[, i])
        }
    }

    return(C)
}

Try the UNCLES package in your browser

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

UNCLES documentation built on May 2, 2019, 11:11 a.m.