-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
colour labels in the dendrograms with zero height terminal branches #3
Comments
Dear Varmara, The short answer is that I fixed this issue, and you can use the fixed code in dendextend version 0.17.3, which is now on github (it will take another month or so before I'll upload it to CRAN). The longer answer is that: Here is a self contained example that shouldn't work in 0.17.2, but now works in 0.17.3: dend_flat <- structure(list(structure(88L, members = 1L, height = 0, label = "mel Ch m pe", leaf = TRUE, value = 83),
structure(list(structure(92L, members = 1L, height = 0, label = "mel Ch f fo", leaf = TRUE, value = 84),
structure(list(structure(90L, members = 1L, height = 0, label = "mel Ch f he", leaf = TRUE, value = 85),
structure(list(structure(84L, label = "mel Ch m he", members = 1L, height = 0, leaf = TRUE, value = 86),
structure(86L, label = "mel Ch m fo", members = 1L, height = 0, leaf = TRUE, value = 87)), members = 2L, midpoint = 0.5, height = 0, value = 86.5)), members = 3L, midpoint = 0.75, height = 0, value = 85.75)), members = 4L, midpoint = 0.875, height = 0, value = 84.875)), members = 5L, midpoint = 0.9375, height = 0.0697674418604651, value = 83.9375, class = "dendrogram")
dend_flat %>% color_labels %>% plot # doesn't work in 0.17.2, but it is fixed in 0.17.3
dend_flat %>% color_labels(col = 1:2) %>% plot # doesn't work in 0.17.2, but it is fixed in 0.17.3 Your report has actually surfaced another issue in |
Thanks, it works fine now |
My pleasure varmara :) |
Hello, Tal,
I'm trying to colour labels in the two dendrograms that contain terminal branches with zero height.
One of the dendrograms is coloured successfully, the other one fails with an error message from cutree_1k.dendrogram.
Does it happen because the first dendrogram contains the branches with zero height only with 2 leaves, while the other one has up to 4 leaves in such branches?
Could you suggest any solution?
With best regards,
Marina
Here is the link to the Rdata and the code
The text was updated successfully, but these errors were encountered: