GG_heatmap | R Documentation |
Heatmap correlation matrix with ggplot2
GG_heatmap(
data,
add_values = T,
reorder_vars = T,
digits = 2,
font_size = 4,
color_label = "Pearson\nCorrelation",
legend_position = c(0.4, 0.7),
short_x_labels = F,
axis_labels_clean_func = str_clean,
dodge_x_labels = 1,
min_n = 0,
pairwise_n = NULL
)
data |
Data frame or a matrix |
add_values |
Whether to add the correlation sizes as text to plot |
reorder_vars |
Whether to reorder variables so strongly related ones are close to each other |
digits |
How many digits to print when plotting them |
font_size |
If correlation values are plotted, their size |
color_label |
Which label to use for the color scale legend |
legend_position |
Position of the legend. Sometimes you may need to move it a bit |
short_x_labels |
Adds integers to the y axis labels, and replaces the x labels with the same integers. Useful when there are many variables. |
axis_labels_clean_func |
A function to clean the labels with, typically to remove underscores. NULL means disable. |
dodge_x_labels |
How much to dodge the x labels. Useful when there are many variables. |
min_n |
Minimum number of observations to include a correlation |
a ggplot2 object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.