Take a correlation matrix and replace the correlation coefficients by symbols according to the level of the correlation.
a correlation matrix. Particularly, an object of class cor_mat
.
numeric vector used for intervals. Default values are
c(0, 0.25, 0.5, 0.75, 1)
.
character vector, one shorter than cutpoints, used as
correlation coefficient symbols. Default values are c(" ", ".", "+",
"*")
.
cor_mat()
# 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()
#> rowname mpg disp hp drat wt qsec
#> 1 mpg
#> 2 disp *
#> 3 hp * *
#> 4 drat + + .
#> 5 wt * * + +
#> 6 qsec . . +