corr_mtr_to_df: Convert correlation matrix to data.frame

View source: R/S4-Correlation.R

corr_mtr_to_dfR Documentation

Convert correlation matrix to data.frame

Description

Converts a correlation matrix to a tidy data.frame in which observations are correlation pairs.

Usage

corr_mtr_to_df(mtr, type = "complete", diagonal = TRUE, distinct = FALSE)

Arguments

mtr

A correlation matrix.

type

Character value. Denotes how the underlying correlation matrix is handled. Three options:

  • 'complete': The matrix stays as is.,

  • 'lower': The part below the diagonal is used. The upper part is set to NA.,

  • 'upper':The part above the diagonal is used. the lower part is set to NA.

diagonal

Logical value. Indicates if the diagonal values of the matrices are kept ( = TRUE) or set to NA (= FALSE). Ignored if type = 'complete'.

distinct

Logical value. If TRUE only one observation per variable pair remains in the output data.frame.


kueckelj/confuns documentation built on July 4, 2024, 4:53 p.m.