cluster_within_group: Cluster within and between Groups

Description Usage Arguments Details Value Examples

View source: R/grid.dendrogram.R

Description

Cluster within and between Groups

Usage

1

Arguments

mat

A matrix where clustering is applied on columns.

factor

A categorical vector.

Details

The clustering is firstly applied in each group, then clustering is applied to group means. The within-group dendrograms and between-group dendrogram are finally connected by merge_dendrogram.

In the final dendrogram, the within group dendrograms are enforced to be flat lines to emphasize that the within group dendrograms have no sense to compare to between-group dendrogram.

Value

A dendrogram object. The order of columns can be retrieved by order.dendrogram.

Examples

1
2
3
4
5
m = matrix(rnorm(120), nc = 12)
colnames(m) = letters[1:12]
fa = rep(c("a", "b", "c"), times = c(2, 4, 6))
dend = cluster_within_group(m, fa)
grid.dendrogram(dend, test = TRUE)

Example output

Loading required package: grid
========================================
ComplexHeatmap version 2.6.2
Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
Github page: https://github.com/jokergoo/ComplexHeatmap
Documentation: http://jokergoo.github.io/ComplexHeatmap-reference

If you use it in published research, please cite:
Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 
  genomic data. Bioinformatics 2016.

This message can be suppressed by:
  suppressPackageStartupMessages(library(ComplexHeatmap))
========================================

ComplexHeatmap documentation built on Nov. 14, 2020, 2:01 a.m.