rlbarter / superheat

An r package for generating beautiful and customizable heatmaps
https://rlbarter.github.io/superheat/
235 stars 29 forks source link

bug generate_cluster_label Error in formals(themes) : object 'themes' not found #31

Closed jamesdalg closed 6 years ago

jamesdalg commented 6 years ago

row_block_ids [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [95] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [189] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 generate_cluster_label(membership = row_block_ids,location = "bottom",label.col = "white",label.text.col = "black",label.text.alignment = "center",text.angle = 0)

Error in formals(themes) : object 'themes' not found Called from: formals(themes)

jamesdalg commented 6 years ago

Are there any good examples of this function? I really just want to take an unclustered heatmap and then label the clusters with two text labels c("text label 1", "text_label_2") and have them plotted as the label for the matrix. Is there any way to do this?

rlbarter commented 6 years ago

Sorry - This function is unsupported and will be removed from future versions of the package. I would suggest using hclust() or kmeans() (or any other clustering function) for generating cluster labels and then supply the subsequent label vector to the membership.rows or membership.cols arguments in the superheat() function.

rlbarter commented 6 years ago

You can also use the bottom.label = "cluster" and left.label = "cluster" arguments to have the labels be just the cluster names.