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

cor_as_symbols

Replace Correlation Coefficients by Symbols


Description

Take a correlation matrix and replace the correlation coefficients by symbols according to the level of the correlation.

Usage

cor_as_symbols(
  x,
  cutpoints = c(0, 0.25, 0.5, 0.75, 1),
  symbols = c(" ", ".", "+", "*")
)

Arguments

x

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

cutpoints

numeric vector used for intervals. Default values are c(0, 0.25, 0.5, 0.75, 1).

symbols

character vector, one shorter than cutpoints, used as correlation coefficient symbols. Default values are c(" ", ".", "+", "*").

See Also

Examples

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

# Replace correlation coefficient by symbols
#::::::::::::::::::::::::::::::::::::::::::
cor.mat %>%
  cor_as_symbols() %>%
  pull_lower_triangle()

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.