R/cov2corMod.R

Defines functions cov2corMod

# cov2corMod: The cov2cor function that takes care of the zero-variance
# variables

cov2corMod <- function(V) {
    targetCol <- which(diag(V) != 0)
    if (length(targetCol) > 0) 
        V[targetCol, targetCol] <- cov2cor(as.matrix(V[targetCol, targetCol]))
    return(V)
} 

Try the simsem package in your browser

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

simsem documentation built on March 29, 2021, 1:07 a.m.