correlation_matrix {corrtable} | R Documentation |
Creates a publication-ready / formatted correlation matrix, using Hmisc::rcorr
in the backend.
Description
Creates a publication-ready / formatted correlation matrix, using Hmisc::rcorr
in the backend.
Usage
correlation_matrix(
df,
type = "pearson",
digits = 3,
decimal.mark = ".",
use = "all",
show_significance = TRUE,
replace_diagonal = FALSE,
replacement = ""
)
Arguments
df |
dataframe; containing numeric and/or logical columns to calculate correlations for |
type |
character; specifies the type of correlations to compute; gets passed to |
digits |
integer/double; number of decimals to show in the correlation matrix; gets passed to |
decimal.mark |
character; which decimal.mark to use; gets passed to |
use |
character; which part of the correlation matrix to display; options are |
show_significance |
boolean; whether to add |
replace_diagonal |
boolean; whether to replace the correlations on the diagonal; defaults to |
replacement |
character; what to replace the diagonal and/or upper/lower triangles with; defaults to |
Value
a correlation matrix
Examples
correlation_matrix(iris)
correlation_matrix(mtcars)