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

Cutting out a cluster from dendrogram

I am using this link to plot a nice dendrogram with colored labels as per the categories. The second answer is what I am looking at in this link (Tree cut and Rectangles around clusters for a horizontal dendrogram in R )which uses the code below: d…
user45292
  • 45
  • 1
  • 9
1
vote
1 answer

Labels in dendrogram in R

I am working on dendrogram plot(clust.res, hang=-1, main=dedro,labels=data1$Name.of.the.variety) Then message that I get are: Warning messages: "labels" is not a graphical parameter
1
vote
1 answer

How to use identify to a horizontal dendrogram of class "dendrogram" in R

I am using identify to explore specific features of clusters in a dendrogram in R. Identify is working perfectly fine by using a 'hclust' object, but I need it for a horizontal dendrogram of class 'dendrogram' instead of 'hclust'. I have the package…
jedgroev
  • 115
  • 5
1
vote
0 answers

Renaming Rows to control items in dist() and promp() objects

I have a data frame called family 1 (below). This data will be used for constructing dendrograms and for principal component analysis. I would like to control the names of items in both dist() and promp() objects, which use row names to indicate the…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
1
vote
2 answers

How to access attributes of a dendrogram in R

From a dendrogram which i created with hc<-hclust(kk) hcd<-as.dendrogram(hc) i picked a subbranch k=hcd[[2]][[2]][[2]][[2]][[2]][[2]][[2]][1] When i simply have k displayed, this gives: > k [[1]] [[1]][[1]] [1] 243 attr(,"label") [1]…
user1479670
  • 1,145
  • 3
  • 10
  • 22
1
vote
1 answer

Label and color each specimens name with different color with Deprogram in R

Can someone help me, please? I am trying to draw dendrogram using DNA distance matrix using the following code. Everything is seem fine but I do not seem to be able to have each specimens with different color; The file of my distance matrix is in…
user48386
  • 95
  • 1
  • 6
0
votes
0 answers

R rect.dendrogram() and problem with h parameter

Is it a bug or an intended behavior of rect.dendrogram() function in dendextend? Below is a demonstration code. First build a very simple dendrogram: library(dendextend) dend <- 1:5 %>% dist %>% hclust %>% as.dendrogram Then plot it with h =…
artgram
  • 144
  • 4
0
votes
1 answer

specifying three cluster groups, but dendrogram clusters into four

I'm having a frustrating problem that I can't reproduce (I wish I could). I've generated dendrograms with three ecological datasets, using the same code but unique objects for each. Each leaf in the dendrograms is a survey plot, with species…
0
votes
1 answer

Error in .rect_dendrogram(dend, k = k, palette = rect_border, rect_fill = rect_fill, : k must be between 2 and 97

I am trying to estimate a cluster dendrogram in R for a structural topic model I produced with 98 topics. I first ran the following which worked well: res.hc <- eclust(scale(out_corr$cor), "hclust", nboot = 500) I then attempting to visualize the…
0
votes
1 answer

Ordering colors on colored bar for dendrogram in R

The vignette for the R package dendextend (https://cran.r-project.org/web/packages/dendextend/vignettes/dendextend.html) gives an example of using the colored_bars function with cutreeDynamic from package dynamicTreeCut as follows: # let's get the…
panda
  • 821
  • 1
  • 9
  • 20
0
votes
1 answer

Add labels in dendogram in R

I am trying to apply Hierarchical Clustering for Time Series in order to identify the states with similar behaviors in the time series for residential_percent_change_from_baseline. I get the dendrogram but the index i get in the x axis are just…
0
votes
1 answer

groupLabels not shown when using dendextend colour_branches

The workflow I want to implement is: dm <- dist(data) dend <- hclust(dm) k <- stats::cutree(dend, k = 10) data$clusters <- k plot(hclust, colorBranchees = k) #???? What I can use here. So I searched for color dendrogram branches using cutree…
witek
  • 984
  • 1
  • 8
  • 25
0
votes
1 answer

How to label just one observation in hierarchical clustering tree with dendextend?

I'd like to create a hierarchical clustering tree of a relatively large dataset (>3000 obs). Unfortunately, by including so many labels at the terminal nodes, the tree looks very cluttered and contains lots of unnecessary information. So to reduce…
Tea Tree
  • 882
  • 11
  • 26
0
votes
1 answer

Is it possible to change the order of columns in heatmaply?

I have created a dendrogram with heatmaply with a dendrogram object from the dendextend package. I was wondering if there is a way to change the order of the columns: vs, am, carb, wt, drat, gear, etc. For example, I want to sort them…
0
votes
1 answer

Zoom and plot only specific node for a given dendogram

Hi suppose I generated a dendogram as such: library(dendextend) library(tidyverse) mtcars %>% select(mpg, cyl, disp) %>% dist() %>% hclust() %>% as.dendrogram() -> dend dend %>% set("nodes_pch", 19) %>% …
Ahdee
  • 4,679
  • 4
  • 34
  • 58