Skip to contents

Draw interactive heatmaps using heatmaply.

Usage

draw_heatmap(
  x,
  Rowv = TRUE,
  Colv = TRUE,
  cluster = FALSE,
  symm = FALSE,
  cellnote = NULL,
  colorgrad_n = 101,
  colors = NULL,
  space = "rgb",
  lo = "#18A3AC",
  lomid = NULL,
  mid = NULL,
  midhi = NULL,
  hi = "#F48024",
  k_row = 1,
  k_col = 1,
  grid_gap = 0,
  limits = NULL,
  margins = NULL,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  key_title = NULL,
  showticklabels = NULL,
  colorbar_len = 0.7,
  plot_method = "plotly",
  theme = rtemis_theme,
  row_side_colors = NULL,
  row_side_palette = NULL,
  col_side_colors = NULL,
  col_side_palette = NULL,
  font_size = NULL,
  padding = 0,
  displayModeBar = TRUE,
  modeBar_file_format = "svg",
  filename = NULL,
  file_width = 500,
  file_height = 500,
  file_scale = 1,
  ...
)

Arguments

x

Input matrix.

Rowv

Logical or dendrogram. If Logical: Compute dendrogram and reorder rows. Defaults to FALSE. If dendrogram: use as is, without reordering. See more at heatmaply::heatmaply("Rowv").

Colv

Logical or dendrogram. If Logical: Compute dendrogram and reorder columns. Defaults to FALSE. If dendrogram: use as is, without reordering. See more at heatmaply::heatmaply("Colv").

cluster

Logical: If TRUE, set Rowv and Colv to TRUE.

symm

Logical: If TRUE, treat x symmetrically - x must be a square matrix.

cellnote

Matrix with values to be displayed on hover. Defaults to ddSci(x).

colorgrad_n

Integer: Number of colors in gradient. Default = 101.

colors

Character vector: Colors to use in gradient.

space

Character: Color space to use. Default = "rgb".

lo

Character: Color for low values. Default = "#18A3AC".

lomid

Character: Color for low-mid values.

mid

Character: Color for mid values.

midhi

Character: Color for mid-high values.

hi

Character: Color for high values. Default = "#F48024".

k_row

Integer: Number of desired number of groups by which to color dendrogram branches in the rows. Default = 1.

k_col

Integer: Number of desired number of groups by which to color dendrogram branches in the columns. Default = 1.

grid_gap

Integer: Space between cells. Default = 0 (no space).

limits

Float, length 2: Determine color range. Default = NULL, which automatically centers values around 0.

margins

Float, length 4: Heatmap margins.

main

Character: Main title.

xlab

Character: x-axis label.

ylab

Character: y-axis label.

key_title

Character: Title for the color key.

showticklabels

Logical: If TRUE, show tick labels.

colorbar_len

Numeric: Length of the colorbar.

plot_method

Character: Plot method to use. Default = "plotly".

theme

rtemis theme to use.

row_side_colors

Data frame: Column names will be label names, cells should be label colors. See heatmaply::heatmaply("row_side_colors").

row_side_palette

Color palette function. See heatmaply::heatmaply("row_side_palette").

col_side_colors

Data frame: Column names will be label names, cells should be label colors. See heatmaply::heatmaply("col_side_colors").

col_side_palette

Color palette function. See heatmaply::heatmaply("col_side_palette").

font_size

Numeric: Font size.

padding

Numeric: Padding between cells.

displayModeBar

Logical: If TRUE, display the plotly mode bar.

modeBar_file_format

Character: File format for image exports from the mode bar.

filename

Character: File name to save the plot.

file_width

Numeric: Width of exported image.

file_height

Numeric: Height of exported image.

file_scale

Numeric: Scale of exported image.

...

Additional arguments to be passed to heatmaply::heatmaply.

Value

A heatmaply object.

Author

EDG

Examples

if (FALSE) { # \dontrun{
x <- rnormmat(200, 20)
xcor <- cor(x)
draw_heatmap(xcor)
} # }