View source: R/correlation_matrix.R
correlation_matrix | R Documentation |
Hmisc::rcorr
in the backend.Creates a publication-ready / formatted correlation matrix, using Hmisc::rcorr
in the backend.
correlation_matrix(
df,
type = "pearson",
digits = 3,
decimal.mark = ".",
use = "all",
show_significance = TRUE,
replace_diagonal = FALSE,
replacement = ""
)
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 |
a correlation matrix
correlation_matrix(iris)
correlation_matrix(mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.