R/gen.downset.R

Defines functions gen.downset

Documented in gen.downset

gen.downset <-
function(z, Q=1) {
    if(is.numeric(Q)) {
        v <- 1:nrow(z)
        Q <- v %in% Q
    }
    if(is.character(Q))
        Q <- rownames(z) %in% Q
    if(!is.downset(z, Q))
        stop(paste(toString(rownames(z)[Q]), "is not a downset"))
    sub <- z[Q, Q]
    class(sub) <- class(z)
    Q[Q] <- maximal(sub)
    names(Q) <- rownames(z)
    return(Q)
}

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.