Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cor_reorder

Reorder Correlation Matrix


Description

reorder correlation matrix, according to the coefficients, using the hierarchical clustering method.

Usage

cor_reorder(x)

Arguments

x

a correlation matrix. Particularly, an object of class cor_mat.

Value

a data frame

See Also

Examples

# Compute correlation matrix
#::::::::::::::::::::::::::::::::::::::::::
cor.mat <- mtcars %>%
  select(mpg, disp, hp, drat, wt, qsec) %>%
  cor_mat()

# Reorder by correlation and get p-values
#::::::::::::::::::::::::::::::::::::::::::
# Reorder
cor.mat %>%
  cor_reorder()
# Get p-values of the reordered cor_mat
cor.mat %>%
  cor_reorder() %>%
  cor_get_pval()

rstatix

Pipe-Friendly Framework for Basic Statistical Tests

v0.7.0
GPL-2
Authors
Alboukadel Kassambara [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.