ggcormat | R Documentation |

`ggcormat`

makes the same correlation matrix as cortestR
and graphically represents it in a plot

```
ggcormat(
cor_mat,
p_mat = NULL,
method = "Correlation",
title = "",
maxpoint = 2.1,
textsize = 5,
axistextsize = 2,
titlesize = 3,
breaklabels = NULL,
lower_only = TRUE,
.low = "blue3",
.high = "red2",
.legendtitle = NULL
)
```

`cor_mat` |
correlation matrix as produced by cor. |

`p_mat` |
Optional matrix of p-values; if provided, this is used to define size of dots rather than absolute correlation. |

`method` |
text specifying type of correlation. |

`title` |
plot title. |

`maxpoint` |
maximum for scale_size_manual, may need adjustment depending on plotsize. |

`textsize` |
for theme text. |

`axistextsize` |
relative text size for axes. |

`titlesize` |
as you already guessed, relative text size for title. |

`breaklabels` |
currently not used, intended for str_wrap. |

`lower_only` |
should only lower triangle be plotted? |

`.low` |
Color for heatmap. |

`.high` |
Color for heatmap. |

`.legendtitle` |
Optional name for color legend. |

A ggplot object, allowing further styling.

```
coeff_pvalues <- cortestR(mtcars[, c("wt", "mpg", "qsec", "hp")],
split = TRUE, sign_symbol = FALSE
)
# focus on coefficients:
ggcormat(cor_mat = coeff_pvalues$corout, maxpoint = 5)
# size taken from p-value:
ggcormat(
cor_mat = coeff_pvalues$corout,
p_mat = coeff_pvalues$pout, maxpoint = 5)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.