hmDendrogram: Set d3heatmap dendrograms

View source: R/hmDendrogram.R

hmDendrogramR Documentation

Set d3heatmap dendrograms

Description

Set and adjust the dendrograms for a d3heatmap object

Usage

hmDendrogram(
  d3heatmap,
  dendrogram = c("row", "column", "both", "none"),
  reorder,
  row.reorder,
  column.reorder,
  distance.function,
  clustering.function,
  reorder.function,
  groups,
  symmetrical
)

Arguments

d3heatmap

Required A valid d3heatmap object

dendrogram

Required The dendrogram to process in this call, among 'row', 'col', 'both', 'none'. Using the 'none' value turns off any previous dendrogram settings. If reorder or row.reorder and col.reorder are FALSE or NULL and dendrogram is 'both', then a warning is issued and row.reorder (or col.reorder) arguments are honored.

reorder

a parameter that allows the user to pass in a single reordering value to use on the dendrograms specified in the dendrogram argument.

row.reorder

determines if and how the row dendrogram should be reordered. By default, it is TRUE, which implies dendrogram is computed and reordered based on row means. If NULL or FALSE, then no dendrogram is computed and no reordering is done. If a dendrogram, then it is used "as-is", i.e., without any reordering. If a vector of integers, then dendrogram is computed and reordered based on the order of the vector.

column.reorder

determines if and how the column dendrogram should be be reordered. Has the options as the Rowv argument above and additionally when x is a square matrix, Colv = "Rowv" means that columns should be treated identically to the rows.

distance.function

function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.

clustering.function

function used to compute the hierarchical clustering when Rowv or Colv are not dendrograms. Defaults to hclust.

reorder.function

function(d, w) of dendrogram and weights for reordering the row and column dendrograms.

groups

an integer scalar with the desired number of groups by which to color the dendrogram's branches (uses color_branches)

symmetrical

logical indicating if x should be treated symmetrically; can only be true when x is a square matrix.

Value

Modified d3heatmap object

Source

The interface was inspired by dygraphs

See Also

heatmap, heatmap.2

Examples

## Not run: 

d3heatmap(mtcars, scale = "column", col = "Blues") %>%
  hmDendrogram(dendrogram = 'row', groups = 3)


## End(Not run)


rstudio/d3heatmap documentation built on Nov. 18, 2024, 9:20 a.m.