add_col_clusters: add_col_clusters

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Add column groups and order columns based on groups

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'Iheatmap'
add_col_clusters(
  p,
  clusters,
  name = "Col<br>Clusters",
  reorder = TRUE,
  side = c("top", "bottom"),
  xname = current_xaxis(p),
  ...
)

Arguments

p

iheatmap object

clusters

cluster assignments, should be vector of integers, characters, or factors

name

name of colorbar indicating cluster membership

reorder

reorder rows based on clusters? default is TRUE

side

side of plot on which to add subplot

xname

name of xaxis

...

additional arguments to pass to add_col_groups for creation of annotation heatmap indicating cluster membership

Details

This function is very similar to add_col_groups; the main difference is that with this function column will get reordered based on the groups.

Value

Iheatmap-class object, which can be printed to generate an interactive graphic

Author(s)

Alicia Schep

See Also

add_row_clusters, add_col_clustering, iheatmap

Examples

1
2
3
4
5
6
7
mat <- matrix(rnorm(20), ncol = 5, nrow = 4)
clusters <- c("A","B","A","B","A")

hm <- iheatmap(mat) %>% add_col_clusters(clusters)

# Print heatmap if interactive session 
if (interactive()) hm 

iheatmapr documentation built on July 8, 2020, 7:18 p.m.