ggcorrmat | R Documentation |
Correlation matrix or a dataframe containing results from pairwise
correlation tests. The package internally uses ggcorrplot::ggcorrplot
for
creating the visualization matrix, while the correlation analysis is carried
out using the correlation::correlation
function.
ggcorrmat( data, cor.vars = NULL, cor.vars.names = NULL, output = "plot", matrix.type = "upper", type = "parametric", tr = 0.2, partial = FALSE, k = 2L, sig.level = 0.05, conf.level = 0.95, bf.prior = 0.707, p.adjust.method = "holm", pch = "cross", ggcorrplot.args = list(method = "square", outline.color = "black", pch.cex = 14), package = "RColorBrewer", palette = "Dark2", colors = c("#E69F00", "white", "#009E73"), ggtheme = ggstatsplot::theme_ggstatsplot(), ggplot.component = NULL, title = NULL, subtitle = NULL, caption = NULL, ... )
data |
Dataframe from which variables specified are preferentially to be taken. |
cor.vars |
List of variables for which the correlation matrix is to be
computed and visualized. If |
cor.vars.names |
Optional list of names to be used for |
output |
Character that decides expected output from this function. If
|
matrix.type |
Character, |
type |
A character specifying the type of statistical approach:
You can specify just the initial letter. |
tr |
Trim level for the mean when carrying out |
partial |
Can be |
k |
Number of digits after decimal point (should be an integer)
(Default: |
sig.level |
Significance level (Default: |
conf.level |
Scalar between |
bf.prior |
A number between |
p.adjust.method |
Adjustment method for p-values for multiple
comparisons. Possible methods are: |
pch |
Decides the point shape to be used for insignificant correlation
coefficients (only valid when |
ggcorrplot.args |
A list of additional (mostly aesthetic) arguments that
will be passed to |
package, palette |
Name of the package from which the given palette is to
be extracted. The available palettes and packages can be checked by running
|
colors |
A vector of 3 colors for low, mid, and high correlation values.
If set to |
ggtheme |
A |
ggplot.component |
A |
title |
The text for the plot title. |
subtitle |
The text for the plot subtitle. Will work only if
|
caption |
The text for the plot caption. This argument is relevant only
if |
... |
Currently ignored. |
For details, see: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html
grouped_ggcorrmat
ggscatterstats
grouped_ggscatterstats
# for reproducibility set.seed(123) library(ggstatsplot) # to get a plot (assumes that `ggcorrplot` is installed) if (require("ggcorrplot")) ggcorrmat(iris) # to get a dataframe ggcorrmat( data = ggplot2::msleep, cor.vars = sleep_total:bodywt, partial = TRUE, output = "dataframe" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.