Learn R Programming

ggalign (version 0.0.4)

hmanno: Determine the active context of heatmap layout

Description

Determine the active context of heatmap layout

Usage

hmanno(
  position = NULL,
  size = NULL,
  guides = NA,
  free_guides = NA,
  free_spaces = NA,
  plot_data = NA,
  theme = NA,
  free_labs = NA,
  what = waiver(),
  width = NULL,
  height = NULL
)

Value

A heatmap_active object which can be added into heatmap_layout.

Arguments

position

Which heatmap annotation should get activated? Possible values are follows:

  • A string of "top", "left", "bottom", or "right".

  • NULL: means set the active context into the heatmap itself.

size

An unit object to set the total size of the heatmap annotation. This will only be used if position is a string.

  • If position is "top" or "bottom", size set the total height of the annotation.

  • If position is "left" or "right", size set the total width of the annotation.

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

  • If position is NULL, this applies to the heamtap layout.

  • If position is a string, this applies to the heatmap annotation stack layout.

free_guides

Override the guides collection behavior specified in the heatmap layout. Options include:

  • waiver(): inherits behavior from the layout.

  • NULL: no guide legends will be collected for the plot.

  • A string containing one or more of "t", "l", "b", and "r" indicates which side of guide legends should be collected for the plot.

guides argument controls the global guide collection behavior for all plots in the layout, while the free_guides argument overrides this for a single plot in the layout.

free_spaces

A string with one or more of "t", "l", "b", and "r" indicating which border spaces should be removed. Defaults to waiver(), which inherits from the parent layout. If no parent, the default is NULL, meaning no spaces are removed.

plot_data

A function to transform plot data before rendering. Defaults to waiver(), which inherits from the parent layout. If no parent layout, the default is NULL, meaning the data won't be modified.

Used to modify the data after layout has been created, which should be a data frame, but before the data is handled of to the ggplot2 for rendering. Use this hook if the you needs change the default data for all geoms.

theme

Default theme for the plot in the layout. One of:

  • waiver(): will inherit from the parent layout.

  • NULL: Use the default theme.

  • theme(): will be added with the parent layout theme.

free_labs

A string with one or more of "t", "l", "b", and "r" indicating which axis titles should be free from alignment. Defaults to waiver(), which inherits from the parent layout. If no parent layout, no axis titles will be aligned. If NULL, all axis titles will be aligned.

what

What should get activated for the anntoation stack? Only used when position is a string. Options include::

  • A single number or string of the plot elements in the stack layout.

  • NULL: remove any active context.

width, height

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

Examples

Run this code
ggheatmap(matrix(rnorm(81), nrow = 9)) +
    hmanno("top") +
    align_dendro()

Run the code above in your browser using DataLab