View source: R/correlation_matrix.R
correlation_matrix | R Documentation |
Creates a correlation matrix
correlation_matrix(
data = NULL,
var_names = NULL,
row_var_names = NULL,
col_var_names = NULL,
round_r = 2,
round_p = 3,
output_type = "rp",
numbered_cols = NULL
)
data |
a data object (a data frame or a data.table) |
var_names |
names of the variables for which to calculate all pairwise correlations |
row_var_names |
names of the variables that will go on the rows of the correlation matrix |
col_var_names |
names of the variables that will go on the columns of the correlation matrix |
round_r |
number of decimal places to which to round correlation coefficients (default = 2) |
round_p |
number of decimal places to which to round p-values (default = 3) |
output_type |
which value should be filled in cells of the
correlation matrix? If |
numbered_cols |
logical. If |
the output will be a correlation matrix in a data.table format
correlation_matrix(data = mtcars, var_names = c("mpg", "cyl", "wt"))
correlation_matrix(data = mtcars,
row_var_names = c("mpg", "cyl", "hp"), col_var_names = c("wt", "am"))
correlation_matrix(
data = mtcars, var_names = c("mpg", "cyl", "wt"),
numbered_cols = FALSE)
correlation_matrix(
data = mtcars, var_names = c("mpg", "cyl", "wt"), output_type = "r")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.