R/ccor.R

ccor <-
function (vcv) 
{
    if (length(vcv) == 1) {
        xx <- as.matrix(1)
    }
    else {
        xx <- diag(1/sqrt(abs(diag(vcv)))) %*% vcv %*% diag(1/sqrt(abs(diag(vcv))))
    }
    dimnames(xx) <- dimnames(vcv)
    return(xx)
}
Auburngrads/SMRD documentation built on Sept. 14, 2020, 2:21 a.m.