prepare_correlation_table {ExPanDaR} | R Documentation |
Prepares a Correlation Table
Description
Reads a data frame and presents Pearson correlations above the diagonal and Spearman correlations below.
Usage
prepare_correlation_table(df, digits = 2, bold = 0.05, format = "html", ...)
Arguments
df |
Data frame containing at least two variables that are either numeric or logical and at least five observations. |
digits |
The number of digits that you want to report. |
bold |
Indicate the p-Value for for identifying significant correlations in bold print. Defaults to 0.05. If set to 0, no bold print is being used. |
format |
The format that you want |
... |
Additional parameters that are passed on to |
Value
A list containing four items:
- "df_corr"
A data frame containing the correlations
- "df_prob"
A data frame containing the p-values of the correlations
- "df_n"
A data frame containing the number of observations used for the correlations
- "kable_ret"
The return value provided by
kable
containing the formatted table
Examples
t <- prepare_correlation_table(mtcars)
t$df_corr