R/reviseTpm.R

Defines functions reviseTpm

Documented in reviseTpm

reviseTpm <- function(xisum,mixture) {
    if(mixture)  {
        matrix(apply(xisum,2,sum)/sum(xisum),byrow=TRUE,
               nrow=nrow(xisum),ncol=ncol(xisum))
    } else {
        den <- apply(xisum,1,sum)
        if(any(den == 0))
            stop("At least one row of new tpm would be all zeroes.\n")
        xisum/den
    }
}

Try the eglhmm package in your browser

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

eglhmm documentation built on May 29, 2024, 1:20 a.m.