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 Feb. 12, 2020, 5:57 p.m.