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
0 answers

R dendextend set "leaves_col" converts leaves pch to character

I am creating a dendrogram using dendextend and wish to set leaves as colored symbols. require(ggplot2) require(dendextend) sessionInfo() R version 3.1.3 (2015-03-09) Platform: x86_64-apple-darwin10.8.0 (64-bit) Running under: OS X 10.10.5…
1
vote
1 answer

cor_cophenetic behavior in randomizations

I am working in R, with the dendextend package, trying to compare hclusts objects with cop_cophenetic. I have two objects that rise from clustering: clusts and clusts1, and I want to compare the cophenetic correlation between them. I have a few…
erezgrn
  • 11
  • 1
1
vote
1 answer

How to color dendrogram labels using R based on label name not grouping

I am trying to color the labels of a dendrogram based on a portion of the label name. The label name is derived from file names in a folder. The files are .txt files and are named in this manner: 167_001.txt with the first three numbers indicating a…
DHranger
  • 33
  • 5
1
vote
1 answer

Difficulty comparing dendrograms

I have a dataset with 2 different (1 externally run, 1 done myself) clustering solutions. I want to compare them using the tanglegram and entanglement commands in the dendextend package, however I keep having errors regarding labels and I cannot…
user2498193
  • 1,072
  • 2
  • 13
  • 32
1
vote
1 answer

How to link a dendrogram branch to a class?

I've created a classification and divided the iris dataset into three classes. Afterwards, I would like to link classes (colors) to observations from dataset. I tried to use a cutree function. As a result, I've got classes from 1 to 3 and branches…
Jot eN
  • 6,120
  • 4
  • 40
  • 59
1
vote
1 answer

How to cut a dendrogram in r

Okay so I'm sure this has been asked before but I can't find a nice answer anywhere after many hours of searching. I have some data, I run a classification then I make a dendrogram. The problem has to do with aesthetics, specifically; (1) how to cut…
Tzac
  • 101
  • 2
  • 12
1
vote
0 answers

How to color connecting lines when comparing two dendrograms in R dendextend

I am using dendextend's tanglegram to compare two dendrograms. Almost everything is working, including coloring the node labels to correspond to the clusters. What is not working is that I want all the connecting lines (from a node label in one…
Garry Jost
  • 81
  • 1
  • 1
  • 3
1
vote
1 answer

R: Customized dendrogram - different leave node color and type by label

I have written the following MWE using dendextend (vignette): library(cluster) library(ggdendro) library(dendextend) d1 <- c(paste(rep("firstcelltype",7),1:7,sep="_"), paste(rep("secondcelltype", 3),1:3,sep="_")) d1.df <-…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
1
vote
0 answers

r: Assigning labels to leafs and rectangles to dendrogram using dendextend possible?

I want to plot dendrogram with for dataframe data with 7 columns (2 Factor, 5 num). The first column is containing the names of 7 different countries and in the following columns I have collected data for different parameters (like population, GDP…
Jonathan Rhein
  • 1,616
  • 3
  • 23
  • 47
1
vote
2 answers

Delete Scale for Height in dendrogram visualisation

I can create a dendrogram using x<-1:100 dim(x)<-c(10,10) set.seed(1) groups<-c("red","red", "red", "red", "blue", "blue", "blue","blue", "red", "blue") x.clust<-as.dendrogram(hclust(dist(x))) x.clust.dend <- x.clust labels_colors(x.clust.dend) <-…
discipulus
  • 2,665
  • 3
  • 34
  • 51
1
vote
1 answer

Color side bar dendrogram plot

Initially I was trying to add the horizontal color side bar to the dendrogram plot (NOT to the whole heat map) using colored_bars from dendextend. The code below (THANK YOU for your help Tal!) works pretty well. The only issue remaining is how to…
AussieAndy
  • 101
  • 2
  • 11
1
vote
1 answer

Color Side Bars in heat map and dendrogram

I am trying to add the color side bar to the heat map columns. My cases/samples belongs to different groups/classes (like e.g. samples are the results of many genes expression in various cells and groups are different species). I would like the…
AussieAndy
  • 101
  • 2
  • 11
1
vote
1 answer

Plot Pretty and aligned Colored Dendrograms in R

I am using the Sparcl package (https://cran.r-project.org/web/packages/sparcl/sparcl.pdf) to plot dendrograms in R. In my specific problem, I am clustering the groups according to one criterion, and I want to visualize by coloring based on another…
Josh
  • 1,155
  • 4
  • 12
  • 21
1
vote
1 answer

Swap branches in WGCNA eigengene dendrogram

I am plotting a dendrogram of the moduleeigengenes in the WGCNA package and I want to order/swap the branches. I use the plotEigengeneNetworks function to plot it, but cannot define the order of the branches. I know that there is the dendextend…
1
vote
1 answer

How to color the same labels on dendorgram in one colour in r

I have clustered some data in r and plotted the results as a dendrogram. What i am trying to find out right now is how I can change the colour of the labels, so that labels that are the same have the same colour. I got my dendrogram using the…
sequence_hard
  • 5,115
  • 10
  • 30
  • 50