get_colors_for_discrete_value: Generate custom colors from discrete values for heatmaps.

View source: R/get_colors_for_discrete_value.R

get_colors_for_discrete_valueR Documentation

Generate custom colors from discrete values for heatmaps.

Description

Generate custom colors from discrete values for heatmaps.

Usage

get_colors_for_discrete_value(color_intervals_list, value_intervals_list)

Arguments

color_intervals_list

a list for building color intervals.

value_intervals_list

a list for building value intervals.

Value

A vectors containing color distributions.

Author(s)

Dongdong Zhan and Mengsha Tong

Examples

value_intervals_list <- list(
seq(-4, -2, 0.2),
seq(-2, -1, 0.2),
seq(-1, 1, 0.2),
seq(1, 2, 0.2),
seq(2, 4, 0.2)
)
color_intervals_list <- list(
  c('blue', '#33CCFF'),
  c('#33CCFF', 'green'),
  c('green', 'white', '#FF6600'),
  c('#FF6600', 'red'),
  c('red', 'firebrick')
)
colors <- get_colors_for_discrete_value(
  color_intervals_list,
  value_intervals_list
)
head(colors)


ecnuzdd/PhosMap documentation built on Dec. 7, 2022, 4:09 a.m.