clusterExperiment
clusterExperiment copied to clipboard
plotHeatmap: support ordered factors in sampleData in the legend?
- Can plotHeatmap take account of the order of ordered factors when plotting them in the legend?
- When one of the sampleData metadata has spaces, plotHeatmap breaks with an error that doesn't report what's wrong
library(clusterExperiment)
aaa = matrix(runif(100), nrow = 10)
anno = factor(sample.int(3, size = 10, replace = TRUE), ordered = TRUE)
levels(anno) = c("low activity", "medium activity", "high activity")
#Error in cut.default(a, breaks = 100) : 'x' must be numeric
plotHeatmap(data = aaa, sampleData = as.data.frame(anno))
#works, but ignores the order of the factor
plotHeatmap(data = aaa, sampleData = as.data.frame(make.names(anno)))
I missed the error part of this. So I opened the error as a separate issue and adjusted the title.
Because problem with ordered factors in aheatmap (#184) have not added this yet as enhancement.