R function from {stats} package - hierarchical cluster analysis on a set of dissimilarities and methods for analyzing it.
Questions tagged [hclust]
176 questions
3
votes
1 answer
display clusters in radial format
I have a list of clusters lets say from cluster 1 to cluster 3; along with
their membership for example below. I would like to display the clusters in radial format. I was thinking of using the as.phylo function
in the ape package to display this,…

qfd
- 778
- 2
- 10
- 24
3
votes
0 answers
How to use similarity matrix in hclust
I have a matrix which represents similarity between nodes, how can I use it in hclust method which takes dissimilarity matrices ?
does setting dissimilarity to +1 and similarity to negative values solves the problem ? for example...
bank.albert …

Exorcismus
- 2,243
- 1
- 35
- 68
3
votes
0 answers
Heatmap of biological time course data
The data below shows a subset of my differential expressed genes in my dataset. These genes are changing alot throughout the time course. What is the best way to dispay these changes in a heatmap?
For the moment I used a clustering on time, but…

user3741035
- 2,455
- 4
- 15
- 20
3
votes
1 answer
Clustering given a distance matrix 256x256
So, I have 256 objects, and have calculated the distance matrix (pairwise distances) among them. A subset of my distance matrix is given below:
> dm[1:10, 1:10]
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
[1,] 0 1 1 1 1 2 2 2 1 2
[2,] 1 0 1…

Vahid Mirjalili
- 6,211
- 15
- 57
- 80
3
votes
2 answers
How to create a newick file from a cluster in R?
This script below runs nicely to get the cluster with a huge data set, but I need to get the cluster into a newick file or a text file so I can export it from R to other editing programs but I can't find a way to get the hclust into a newick format,…

user3301513
- 31
- 1
- 2
3
votes
1 answer
Reverse leaf order in dendrogram using R
I have tried for several days to just flip a dendrogram so that the last gene is the first in the figure and the first the last. But even when I have managed to move leaves around the internal ordering is not the same. Here is my…

Miguel Hernandez
- 45
- 1
- 5
3
votes
2 answers
Manipulating cutree object in R to segment original dataframe
I'm using R's built-in correlation matrix and hierarchical clustering methods to segment daily sales data into 10 clusters. Then, I'd like to create agglomerated daily sales data by cluster. I've got as far as creating a cutree() object, but am…

Bryan
- 5,999
- 9
- 29
- 50
3
votes
1 answer
Error in as.dendrogram
I am trying to make a dendrpgram using large data
I am using the stats, phyclust libraries,
distances <- phyclust.edist(Data[,],edist.model = .edist.model[3])
dataHClust <- hclust(distances, "ave")
dhc <- as.dendrogram(dataHClust)
hclust works…

user1562626
- 125
- 1
- 7
2
votes
1 answer
Displaying hierarchical clusters at cluster level (without cases)
I am interested in visualizing the results of a hierarchical cluster analysis. Is it possible to use a dendrogram to display the names or labels of clusters (and subclusters) without displaying the original cases that went into the cluster…

nicholas heimpel
- 45
- 5
2
votes
1 answer
dendrogram from pre-made linkage matrix
the problem:
in R, I need to plot a dendrogram + cut the associated tree from a linkage matrix created in a different language. based on the nature of the dataset, the prior processing is only available with this other language. so I need to be able…

wiscoYogi
- 305
- 2
- 10
2
votes
0 answers
ComplexHeatmap: plot and cluster heatmap with NAs
I am following the documentation on https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html to create a heatmap with NAs. The documentation says that the Heatmap() function can cluster data with NA. However, I am getting an…

Rohit Farmer
- 319
- 4
- 15
2
votes
0 answers
hclust order and cutree groups in R
I want to create a data frame that has my row names, their order according to hclust, and their group membership according to cutree. I'm having a hard time reconciling the outputs from these functions.
d <- dist(USArrests)
hc <-…

Jeff Bezos
- 1,929
- 13
- 23
2
votes
2 answers
Pheatmap won’t cluster rows: NA/NaN/Inf in foreign function call (arg 10)
I have been using the same variations of a pheatmap code to make heat maps for several months now without any problems, but lately it has stopped being able to cluster rows. Columns still cluster like normal but whenever I try to add row clustering…

paige
- 23
- 1
- 3
2
votes
1 answer
Unable to plot hclust object with ggtree
I am trying to plot a dendrogram from a hclust object with ggtree but I keep getting the same error message:
Error: `data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class hclust
I have been extensively…

Markel
- 93
- 1
- 7
2
votes
0 answers
What is the intuition behind centroid linkage in hierarchical clustering?
In the sample code below I would expect a tree with 3 branches if it was really using centroids. Indeed the 2 closest points are A and B with a distance of 1 < sqrt(5)/2. The centroid of cluster (A,B) is (0.5,0) which is also at a distance 1 from C.…

vans2
- 21
- 3