| plot_heatmap | R Documentation |
Generate a heatmap for a given correlation matrix.
plot_heatmap(
cor_mat,
scale = "none",
show_rownames = FALSE,
show_colnames = FALSE,
labels_row = NULL,
labels_col = NULL,
breaks = seq(-1, 1, length.out = 101),
legend_breaks = c(-1, -0.5, 0, 0.5, 1),
legend_labels = c("-1.0", "-0.5", "0", "0.5", "1.0"),
legend_name = "Correlation",
output_path = NULL,
display = TRUE,
render_as = "png",
width = 18,
height = 16,
dpi = 600
)
cor_mat |
A numeric matrix representing the correlation values. |
scale |
Character string indicating how to scale the data. Default is 'none'. |
show_rownames |
Logical indicating whether to show row names. Default is FALSE. |
show_colnames |
Logical indicating whether to show column names. Default is FALSE. |
labels_row |
Character vector of labels for the rows. Default is NULL. |
labels_col |
Character vector of labels for the columns. Default is NULL. |
breaks |
Numeric vector of breakpoints for the heatmap colors. Default is seq(-1, 1, length.out = 101). |
legend_breaks |
Numeric vector of breakpoints for the legend. Default is c(-1, -0.5, 0, 0.5, 1). |
legend_labels |
Character vector of labels for the legend. Default is c("-1.0", "-0.5", "0", "0.5", "1.0"). |
legend_name |
Character string for the legend title. Default is 'Correlation'. |
output_path |
Character string for the output file path. Default is NULL. |
display |
Logical indicating whether to display the plot. Default is TRUE. |
render_as |
Character string indicating the file format to save the plot. Default is 'png'. |
width |
Numeric indicating the width of the plot. Default is 18. |
height |
Numeric indicating the height of the plot. Default is 16. |
dpi |
Numeric indicating the resolution of the plot. Default is 600. |
This function generates a heatmap for a given correlation matrix.
A heatmap plot.
Zhen Lu luzh29@mail2.sysu.edu.cn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.