makeTria: Reshapes an unordered covariance/correlation matrix into...

View source: R/makeTria.r

makeTriaR Documentation

Reshapes an unordered covariance/correlation matrix into triangular shape

Description

Function is mainly used for eatAnalysis::wtdHetcor function from the eatAnalysis package (https://github.com/beckerbenj/eatAnalysis/) and the eatModel::q3FromRes function in the eatModel package: Triangular covariance/correlation matrices are tidily reshaped.

Usage

makeTria (dfr)

Arguments

dfr

A data frame consisting of a row name column and a square matrix.

Value

data frame.

Examples

dfr <- data.frame ( vars = paste0("var", 2:4), matrix(c(1:3, NA, NA, 5, 4,NA,6),
       nrow=3, ncol=3, dimnames=list(NULL, paste0("var", 1:3))))
makeTria(dfr)

eatTools documentation built on Nov. 23, 2023, 5:06 p.m.