matrixToCorCouples: Matrix to couples

View source: R/matrixToCorCouples.R

matrixToCorCouplesR Documentation

Matrix to couples

Description

Transform a correlation matrix into a correlation couples dataframe

Usage

matrixToCorCouples(matrix, coefName = "Coef.", sortByDescAbs = F)

Arguments

matrix

a dataframe corresponding to a matrix of correlation.

coefName

a string: the name of the coefficient the values of the matrix represent.

sortByDescAbs

a boolean to decide if to sort by descending absolute value of the coefficient.

Value

a dataframe corresponding to all correlation couples from the matrix.

Examples

# calculate a correlation dataframe
data(iris)
corDF<-multiBivariateCorrelation(dataset = iris)
corMatrix<-corCouplesToMatrix(x1_x2_val = corDF[,c('X1','X2',"pearson")])
print(corMatrix)
corCouples<-matrixToCorCouples(matrix = corMatrix,coefName="pearson")
print(corCouples)


sambaala/linkspotter documentation built on Oct. 18, 2023, 9:45 p.m.