hmColors: Set d3heatmap color options

Description Usage Arguments Value Source See Also Examples

View source: R/hmColors.R

Description

Set and adjust the colors and color options for the d3heatmap

Usage

1
2
3
4
5
6
7
8
9
hmColors(
  d3heatmap,
  theme = c("", "dark"),
  colors,
  range,
  color.bins,
  symmetrical,
  na.color
)

Arguments

d3heatmap

Required A valid d3heatmap object

theme

A custom CSS theme to use. Currently the only valid values are "" and "dark". "dark" is primarily intended for standalone visualizations, not R Markdown or Shiny.

colors

Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"), or a vector of colors to interpolate in hexadecimal "#RRGGBB" format, or a color interpolation function like colorRamp.

range

A vector of two numbers, namely the minimum and maximum value to use when determining the mapping from values to colors. This is useful when the range of values changes between heatmaps, but colors should be the same (optional, defaults to the minimum and maximum of x).

color.bins

numeric The number of colors to generate from the palette, or the breakpoints between the bins

symmetrical

logical Arrange color bins symmetrically around zero?

na.color

Color of NA values in heatmap. Defaults to neutral gray.

Value

Modified d3heatmap object

Source

The interface was inspired by dygraphs

See Also

heatmap, heatmap.2

Examples

1
2
3
4
5
6
7
8
## Not run: 

d3heatmap(mtcars, dendrogram = 'none', scale = 'column', xaxis_angle = 30) %>% 
  hmColors(colors = 'RdYlGn', color.bins = 12, symmetrical = TRUE)


## End(Not run)
  

rstudio/d3heatmap documentation built on May 26, 2021, 10:16 p.m.