ropensci / iheatmapr

Complex, interactive heatmaps in R
https://docs.ropensci.org/iheatmapr
Other
267 stars 36 forks source link

Error when plotting covariate number exceed available discrete palettes #110

Closed srsankhe closed 2 months ago

srsankhe commented 2 months ago

iheatmapr:::choose_discrete_palette error's out when plotting more than 7 covariates | when number of covariates plotted exceed the available palettes.

vapply(tmp2[which(tmp2 %in% tmp1)], function(x) which(tmp1 == x), "")

Screenshot 2024-09-09 at 11 05 55 AM

alanocallaghan commented 2 months ago

Can you post a reprex? Doesn't error for me

library(iheatmapr)
mat <- matrix(rnorm(100), ncol = 10, nrow = 10)
row_groups <- letters[1:10]
iheatmap(mat) %>% add_row_groups(row_groups, name = "My groups")
srsankhe commented 2 months ago

Going to close this, while trying to generate a reprex this worked as expected. I am guessing something fishy with the data, not sure if any clustering or other modifications make this pop-up. Will do some more digging around

alanocallaghan commented 2 months ago

Thanks, yeah the code doesn't look right but equally I couldn't get it to break, so confused. Will watch for this for sure