Learn R Programming

ggcorrheatmap (version 0.1.2)

move_dendrogram: Move coordinates of dendrogram to edges of heatmap

Description

Move coordinates of dendrogram by calculating distance it has to move to end up at the desired edges of the heatmap

Usage

move_dendrogram(
  dend_seg,
  x_long,
  context = c("rows", "cols"),
  dend_side,
  dend_dist,
  annot_df,
  annot_side,
  annot_pos,
  annot_size
)

Value

Data frame with updated dendrogram coordinates

Arguments

dend_seg

Data frame containing dendrogram segments, attained from dendextend::as.ggdend()

x_long

Long format data frame with the values

context

Character specifying whether the dendrogram is linked to rows or columns in the heatmap

dend_side

Logical specifying dendrogram position. TRUE is left of the heatmap if row dendrogram, bottom of heatmap if column dendrogram

dend_dist

Distance from heatmap (or annotation) to dendrogram in cell size.

annot_df

Data frame with annotations for checking that annotations exist as well as their size

annot_side

Logical specifying annotation position, analogous to dend_side

annot_pos

Numeric vector of annotation coordinates (x coordinates for row annotations, y for column annotations)

annot_size

Numeric of length 1, the specified size (width or height) of annotation cells