ColorMapping: Constructor methods for ColorMapping class

Description Usage Arguments Details Value Author(s) Examples

Description

Constructor methods for ColorMapping class

Usage

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

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 can be ignored.

na_col

colors for NA values.

Details

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

Value

A ColorMapping-class object.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# discrete color mapping for characters
cm = ColorMapping(name = "test",
    colors = c("blue", "white", "red"),
    levels = c("a", "b", "c"))
cm

# discrete color mapping for numeric values
cm = ColorMapping(name = "test",
    colors = c("blue", "white", "red"),
    levels = c(1, 2, 3))
cm

# continuous color mapping
require(circlize)
cm = ColorMapping(name = "test",
    col_fun = colorRamp2(c(0, 0.5, 1), c("blue", "white", "red")))
cm

eilslabs/ComplexHeatmap documentation built on May 16, 2019, 1:21 a.m.