Learn R Programming

iheatmapr (version 0.7.1)

reorder_cols: reorder_cols

Description

Reorder the columns of an Iheatmap-class object

Usage

# S4 method for IheatmapHorizontal,integer
reorder_cols(p, col_order, xname = current_xaxis(p))

# S4 method for IheatmapVertical,integer reorder_cols(p, col_order)

Value

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

Arguments

p

Iheatmap-class object

col_order

integer vector

xname

name of xaxis to reorder, only applicable if object is oriented horizontally

Author

Alicia Schep

See Also

add_row_clustering, reorder_cols

Examples

Run this code

mat <- matrix(rnorm(20), ncol = 5, nrow = 4)  
dend <- hclust(dist(t(mat)))
hm <- iheatmap(mat) %>% reorder_cols(dend$order)

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

Run the code above in your browser using DataLab