cor_matrix | R Documentation |
Calculates the correlation matrix between the numeric variables in a given dataframe and
includes descriptives (mean and standard deviation) - ready for creating a nice table with apa_cor_table
cor_matrix( x, var_names = NULL, method = c("pearson", "spearman", "kendall"), adjust = "none", ... )
x |
Dataframe of variables that can be coerced to numeric. |
var_names |
A named character vector with the names that should be displayed for variables. If NULL, then the variables are not renamed. If names are provided, only the variables included in this vector are retained. |
method |
method="pearson" is the default value. The alternatives to be passed to cor are "spearman" and "kendall" |
adjust |
What adjustment for multiple tests should be used? ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). See |
... |
Arguments passed on to
|
A list including the correlation matrix, p-values, standard errors, t-values, pairwise number of observations, confidence intervals and descriptives
Adapted from http://www.sthda.com/english/wiki/elegant-correlation-table-using-xtable-r-package
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.