reorderHeatmapClusters | R Documentation |
manually reorder ssvHeatmap2 clusters works with any tidy clustered data.table too.
reorderHeatmapClusters( hres, new_cluster_order, id_var = "id", old_cluster_id = "cluster_id", new_cluster_id = "cluster_reorder_id" )
hres |
results of ssvHeatmap2 |
new_cluster_order |
desired top to bottom cluster order |
old_cluster_id |
orginal attribute name for clusters, default is "cluster_id" |
new_cluster_id |
new attribute name for reordered clusters. default is "cluster_reorder_id". can be same as old_cluster_id if you want to replace attribute. |
an ssvH2 object if one supplied as hres. Otherwise a data.table if data.table hres supplied.
res = ssvHeatmap2(heatmap_demo_matrix) print(res) p1 = plot(res) reorder_res = reoderHeatmapClusters(res, c(5, 4, 2, 3, 1)) p2 = plot(reorder_res) cowplot::plot_grid(p1, p2) #works for data.table containing cluster info reorder_dt = reoderHeatmapClusters(h.cluster_data(res), c(5, 4, 2, 3, 1), new_cluster_id = "cluster_id") reorder_dt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.