ColorMapping {ComplexHeatmap} | R Documentation |
Constructor methods for ColorMapping class
ColorMapping(name, colors = NULL, levels = NULL, col_fun = NULL, breaks = NULL, na_col = "#FFFFFF")
name |
name for this color mapping. The name is automatically generated if it is not specified. |
colors |
discrete colors. |
levels |
levels that correspond to |
col_fun |
color mapping function that maps continuous values to colors. |
breaks |
breaks for the continuous color mapping. If |
na_col |
colors for |
colors
and levels
are used for discrete color mapping, col_fun
and
breaks
are used for continuous color mapping.
A ColorMapping-class
object.
Zuguang Gu <z.gu@dkfz.de>
# 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