View source: R/summarise_correlation.R
| summarise_correlation | R Documentation |
Computes correlations between numeric variables of a data frame, or between two vectors. Optionally tests statistical significance (p-value)
summarise_correlation(
x,
y = NULL,
method = c("pearson", "kendall", "spearman"),
cor_test = FALSE
)
x |
A numeric vector, matrix, data frame, or tibble. |
y |
Optional. A second numeric vector, matrix, or data frame (same dimensions as 'x'). |
method |
Character. One of "pearson" (default), "kendall", or "spearman". |
cor_test |
Logical. If TRUE, uses 'cor.test()' and includes p-values. If FALSE, uses 'cor()' only. |
A tibble with variables, correlations, and optionally p-values. Significant results (p < 0.05) are printed in red in the console.
summarise_correlation(iris)
summarise_correlation(iris$Sepal.Length, iris$Petal.Length, cor_test = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.