make_heatmap_color_palette: Create Heatmap Color Palette

View source: R/support_pheatmap.R

make_heatmap_color_paletteR Documentation

Create Heatmap Color Palette

Description

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.

Usage

make_heatmap_color_palette(my_matrix)

Arguments

my_matrix

A numeric matrix for which the heatmap color palette is to be generated.

Value

A character vector of colors representing the heatmap color palette based on the input matrix values.

Examples

# 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)


saezlab/cosmosR documentation built on July 27, 2024, 1:30 p.m.