Learn R Programming

ggalign (version 0.0.4)

heatmap_layout: Arrange plots in a Heatmap

Description

ggheatmap is an alias of heatmap_layout.

Usage

heatmap_layout(
  data,
  mapping = aes(),
  ...,
  filling = TRUE,
  .width = NA,
  .height = NA,
  guides = waiver(),
  theme = NULL,
  set_context = TRUE,
  order = NULL,
  name = NULL
)

ggheatmap( data, mapping = aes(), ..., filling = TRUE, .width = NA, .height = NA, guides = waiver(), theme = NULL, set_context = TRUE, order = NULL, name = NULL )

Value

A HeatmapLayout object.

Arguments

data

A numeric or character vector, a data frame, and any other data which can be converted into a matrix. Simple vector will be converted into a one column matrix.

mapping

Default list of aesthetic mappings to use for plot. In addition, we will always add mapping aes(.data$.x, .data$.y).

...

Additional arguments passed to geom_tile. Only used when filling = TRUE.

filling

A boolean value indicating whether to fill the heatmap. If you wish to customize the filling style, set this to FALSE.

By default, the classic heatmap colour scheme scale_fill_gradient2(low = "blue", high = "red") is utilized for continuous values. You can use the option "ggalign.heatmap_continuous_fill" or "ggalign.heatmap_discrete_fill" to modify the default heatmap body fill color scale. See scale_fill_continuous() or scale_fill_discrete() for option setting details.

.width, .height

Heatmap body width/height, can be a unit object.

guides

A string containing one or more of "t", "l", "b", and "r" indicates which side of guide legends should be collected. If NULL, no guide legends will be collected. If waiver(), it will inherit from the parent layout

theme

A theme() used to render the guides, title, subtitle, caption, margins, patch.title, panel.border, and background. If NULL (default), will inherit from the parent layout.

set_context

A single boolean value indicates whether to set the active context to current plot. If TRUE, all subsequent ggplot elements will be added into this plot.

order

An single integer for the plot area order.

name

A string of the plot name. Used to switch the active context in hmanno() or stack_active().

ggplot2 specification

The data input in ggheatmap will be converted into the long formated data frame when drawing. The default mapping will use aes(.data$.x, .data$.y), you can use mapping argument to control it. The data in the underlying ggplot object contains following columns:

  • .xpanel and .ypanel: the column and row panel

  • .x and .y: the x and y coordinates

  • .row_names and .column_names: A factor of the row and column names of the original matrix (only applicable when names exist).

  • .row_index and .column_index: the row and column index of the original matrix.

  • value: the actual matrix value.

Examples

Run this code
ggheatmap(1:10)
ggheatmap(letters)
ggheatmap(matrix(rnorm(81), nrow = 9L))

Run the code above in your browser using DataLab