R/apply.pca.R

apply.pca <-
function (matrix.signal) 
{
    if (dim(matrix.signal)[2] <= 2) {
        m <- apply(matrix.signal, MARGIN = 1, FUN = mean)
        return(m)
    }
    pca <- prcomp(matrix.signal, scale = TRUE)$x[, 1]
    return(pca/sd(pca))
}

Try the CNVtools package in your browser

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

CNVtools documentation built on April 28, 2020, 6:06 p.m.