megacor | R Documentation |
Creates a nicely formatted correlation table with significance indicators. uses lsr:correlate and adapts a function from http://www.sthda.com/english/wiki/elegant-correlation-table-using-xtable-r-package
megacor(
x,
y = NULL,
corr.method = "pearson",
p.adjust.method = "holm",
removeTriangle = c("none", "upper", "lower"),
result = c("none", "html", "latex")
)
x |
A matrix or dataframe containing variables to be correlated |
y |
Optionally, a second set of variables to be correlated with those in x |
corr.method |
What kind of correlations should be computed? Default is "pearson", but "spearman" and "kendall" are also supported |
removeTriangle |
Specifies the formatting of the output. Which section of the table to remove c("none", "upper", "lower") |
result |
Format for output c("none", "html", "latex") |
dataframe with correlations
megacor(df)
megacor(df[1:4],df[5:8],corr.method = "spearman", removeTriangle = "upper", result = "html")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.