View source: R/support_pheatmap.R
make_heatmap_color_palette | R Documentation |
This function generates a color palette suitable for heatmaps based on the values in a matrix. It uses the 'createLinearColors' function to generate separate color gradients for positive and negative values.
make_heatmap_color_palette(my_matrix)
my_matrix |
A numeric matrix for which the heatmap color palette is to be generated. |
A character vector of colors representing the heatmap color palette based on the input matrix values.
# Create a sample matrix
my_matrix <- matrix(c(-3, -1, 0, 1, 3), nrow = 1)
# Generate heatmap color palette
heatmap_palette <- make_heatmap_color_palette(my_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.