Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ColorMapping

Constructor Method for ColorMapping Class


Description

Constructor Method for ColorMapping Class

Usage

ColorMapping(name, colors = NULL, levels = NULL,
    col_fun = NULL, breaks = NULL, na_col = "#FFFFFF", full_col = NULL)

Arguments

name

Name for this color mapping. The name is automatically generated if it is not specified.

colors

Discrete colors.

levels

Levels that correspond to colors. If colors is name indexed, levels can be ignored.

col_fun

Color mapping function that maps continuous values to colors.

breaks

Breaks for the continuous color mapping. If col_fun is generated by colorRamp2, breaks is automatically inferred from the color mapping function.

na_col

Colors for NA values.

full_col

A super set of colors, used internally.

Details

colors and levels are used for discrete color mapping, col_fun and breaks are used for continuous color mapping.

Value

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

cm = ColorMapping(colors = c("A" = "red", "B" = "black"))
cm
require(circlize)
col_fun = colorRamp2(c(0, 1), c("white", "red"))
cm = ColorMapping(col_fun = col_fun)

ComplexHeatmap

Make Complex Heatmaps

v2.6.2
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.