Skip to contents

Format text of a correlation matrix

Usage

cor_text(r, digits = 2, remove_leading_zero = TRUE, remove_diagonal = FALSE)

Arguments

r

a matrix of correlations

digits

Number of digits to round

remove_leading_zero

If TRUE, remove leading zero from all correlations

remove_diagonal

If TRUE, remove diagonal of ones

Value

a matrix of correlations as text

Examples

cor_text(matrix(.5,2,2))
#>      [,1]  [,2] 
#> [1,] "1"   ".50"
#> [2,] ".50" "1"