melt_rcorr: Melt 'rcorr'

View source: R/S4-Correlation.R

melt_rcorrR Documentation

Melt rcorr

Description

Melts object of class rcorr to a data.frame.

Usage

melt_rcorr(rcorr_obj, type = "complete", diagonal = TRUE, distinct = FALSE)

Arguments

rcorr_obj

An object of class rcorr.

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.

Value

A data.frame with the following columns:

  • var1: Factor. First variable of the correlated variable pair.

  • var2: Factor. Second variable of the correlated variable pair.,

  • corr: Numeric. The correlation vaule.,

  • pval: Numeric. The corresponding p-value.,


kueckelj/confuns documentation built on June 28, 2024, 9:19 a.m.