nice_corrmatrix.Rd
From a data.frame object it gives a correlation matrix formatted for overview
nice_corrmatrix(
cr,
group = NULL,
upper = FALSE,
lower = TRUE,
digits = 2,
show_r = TRUE,
show_p = FALSE,
show_stars = TRUE,
show_ci = FALSE,
numbered_columns = TRUE,
show_descriptives = TRUE,
labels = "auto",
nsig_p = 0.1,
char_nsig,
char_autocor = "-",
char_p10 = "✞",
char_NA = "",
string_ci = "{break_sign}[{ci_lower},{ci_upper}]",
string_p = "{break_sign}(p {nice_p(p, equal_sign = TRUE)})",
caption = NULL,
drop_zero = TRUE,
type = "html",
file = NULL,
...
)
A data frame
a vector with a grouping variable or a character with a variable name. If included, calculates multilevel correlations.
TRUE if upper triangle should be included.
TRUE if lower triangle should be included.
Round to given digit position.
TRUE if r-values should be included.
TRUE if r-values should be included.
TRUE if stars should be included.
If TRUE, confidence intervals are added.
Character string. If "auto" labels are taken from a label attribute.
p level below which correlations are considered not significant.
Character indexing non-significant values.
Character for diagonal (e.g. "-" or "1.00").
Character indexing .10 significance level.
Character for NA values.
Character string in glue format for confindence internvals.
Character string in glue format for p-values.
Caption for an html table.
If TRUE, leadning zeros are dropped.
Character string. "df" for data-frame. "html" for html table.
If TRUE or a filename is provided, a file is exportet (format is defined by file ending eith html or docx).
Further arguments passed to the cor.test()
function.
If TRUE, mean and sd columns are added.
A data-frame or a html table object
nice_corrmatrix(mtcars)
Table
Correlation matrix
Variable
n
M
SD
1
2
3
4
5
6
7
8
9
10
11
Note. ✞p < .10; *p < .05; **p < .01; ***p < .001. .
nice_corrmatrix(mtcars,
show_p = TRUE,
show_ci = TRUE,
show_stars = FALSE,
show_descriptives = FALSE,
conf.level = 0.99
)
Table
Correlation matrix
Variable
1
2
3
4
5
6
7
8
9
10
11
nice_corrmatrix(mtcars, group = "cyl")
#> Error in `.rowNamesDF<-`(x, value = value): invalid 'row.names' length