Questions tagged [dendextend]

Questions on the R package dendextend

The dendextend R package includes functions and methods for extending dendrogram objects in R (visualization, manipulation and comparison).

158 questions
1
vote
1 answer

How do I plot dendrogram leaves by a given value (depth in a sediment core) rather than in sequential order?

I am working with ecological data (the percentage abundance of different diatom species present at different depths in a sediment core) and want to plot the results alongside a dendrogram representing the results of a hierarchical cluster analysis…
Robyn
  • 13
  • 3
1
vote
2 answers

How can I create a large tanglegram in R that is readable and can be saved

I am using cophyloplot to create a tanglegram of two phylogenetic trees. The method works well with small trees but as the trees get larger the output image remains the same size and I can't find a way to expand it. Below is the code for a small…
Jamie
  • 555
  • 3
  • 14
1
vote
0 answers

How to use Dendextend read Newick phylogenetic tree for tree compare?

I am trying to use Dendextend to draw a tanglegram (tangle tree) to interpret the segment-virus reassortment. The newick trees,which I get from other phylogenetic software (like Mrbayes/Raxml),as the input tree files for Dendextend. The newick…
Biodeer
  • 21
  • 5
1
vote
0 answers

pvrect() rectangles in horizontal dendrogram (R)

I am trying to draw rectangles around clusters in a horizontal dendrogram. This works fine as long as I only cut the tree manually, e.g. dend<-as.dendrogram(hc) plot(dend, horiz=T) rect.dendrogram(dend, 3) However, I also want to highlight…
1
vote
0 answers

How to get individually made dendrograms from dendextend to consesnus tree analysis?

I am pretty new to R so I am struggling with the following: I have a dataset where I am clustering several organ`s expresion values per patient. Like this I build 10 individual dendrograms. NOW, I would like to perform a consensus analysis and…
1
vote
1 answer

R rect.hclust: rectangles too high in dendogram

I asked a number of different experts to sort 92 objects based on their similarity. Based on their answers, I constructed a 92 x 92 dissimilarity matrix. in R, I examined this matrix using the following commands: cluster1 <-…
DomB
  • 217
  • 1
  • 4
  • 14
1
vote
0 answers

color node based on category in tanglegram

I am trying to build a tanglegram using dendextra and ggdendro but I can't color nodes based on the category column in tanglegram. Please advise. d1 <- c(1:5) cate <- c("cat1", "cat2", "cat3", "cat1", "cat1") d1 <- data.frame(d1, cate) d2 <-…
KerryLee
  • 373
  • 2
  • 5
  • 13
1
vote
1 answer

How do I add string variables to a dendrogram with labels coloured by factor level?

One of the answers to this question colour codes the labels of a dendogram for a subset of the iris dataset. What I would like to do is retain the string names for the labels so that they'd say setosa, virginica etc.along with their colours. Here's…
adkane
  • 1,429
  • 14
  • 29
1
vote
1 answer

Adding y label to dendextend dendrogram

How can I add a y label to a dendrogram produced by dendextend? This may be used to label "Pairwise Distance", for example. What about for horizontal (ggplot(horiz = T)) dendrograms?
qwr
  • 9,525
  • 5
  • 58
  • 102
1
vote
1 answer

Make dendextend assign colors to branches where I preset colors for leaves

I want to set the color of the branches of my dendrogram, given manually-assigned groups of my leaves. So I know in advance I want to color e.g. leaves A-C in red and all branches which only lead to red leaves shall be colored red as well. I can…
akraf
  • 2,965
  • 20
  • 44
1
vote
1 answer

How to measure similarity between two clustering trees that are produced by hierarchical clustering?

I want to apply a hierarchical clustering method (i.e., agglomerative clustering) over different data sets. I would like to compare the resulted clustering trees. Is there any solution to this? Thanks in advance.
1
vote
1 answer

How to color labels of dendogram with dendextend and heatmap.2 using pre-defined sample groups

heatmap.2 assigns incorrect colors to labels when using "colRow" argument. Is there an alternative way how to assign colors to labels in heatmap.2? Or am I doing something wrong? (examples are based on examples from Label and color leaf dendrogram…
al-ash
  • 197
  • 2
  • 10
1
vote
0 answers

How do I color code only the leaf node labels in a dendrogram?

I am trying to color code only the leaf node labels in a dendogram. I found this stackoverflow post which is the closest to what I am trying to do Label and color leaf dendrogram Tal Galili's answer is useful, but what would I need to do if I DIDN'T…
Antsushi
  • 167
  • 10
1
vote
0 answers

Controlling size/spread of dendrogram using dendextend

Is there a way to control the size or the overall spread of the dendrogram when using the dendextend library? I am using the dendextend library in order to color the lables of my dendrogram. When I plot my cluster without using the dendextend…
Mdhale
  • 815
  • 2
  • 15
  • 22
1
vote
2 answers

Labelling circular dendextend dendrogram

I'm trying to plot a circular dendrogram of compositional data. Using the following code: library(dendextend) library(circlize) library(compositions) data("Hydrochem") hydro<-Hydrochem d <- dist(hydro[7:19], method="euclidean") hc <- hclust(d,…
Scott
  • 311
  • 2
  • 13