Skip to contents

This function updates the covariance matrix with the specified covariance value between two variables.

Usage

fillInCovarMatrice(covarMatrice, covar)

Arguments

covarMatrice

The input covariance matrix.

covar

A data frame containing the covariance value between two variables.

Value

The updated covariance matrix with the specified covariance value filled in.

Examples

covarMat <- matrix(0, nrow = 3, ncol = 3)
colnames(covarMat) <- c("label_varA", "label_varB", "label_varC")
rownames(covarMat) <- c("label_varA", "label_varB", "label_varC")
covarValue <- data.frame("varA.varB" = 0.5)
fillInCovarMatrice(covarMatrice = covarMat, covar = covarValue)
#>            label_varA label_varB label_varC
#> label_varA        0.0        0.5          0
#> label_varB        0.5        0.0          0
#> label_varC        0.0        0.0          0