Questions tagged [hclust]

R function from {stats} package - hierarchical cluster analysis on a set of dissimilarities and methods for analyzing it.

176 questions
1
vote
0 answers

Weighted Cluster Analysis in R — generating more clusters than requested with hclust

I'm trying to conduct a hierarchical agglomerative cluster analysis in R by using the Weighted Cluster package. Before doing so, I calculated the distances between state sequences by leveraging the TraMineR package (see pp. 4-6 here). Following the…
J_Hol
  • 11
  • 1
1
vote
1 answer

Creating dendrograms manually: how to fix "'merge' matrix has invalid contents" in plot.hclust?

I am creating an hclust object manually (i.e. creating a list with the required slots, then changing its class to hclust). The merging pattern, heights of bifurcations, ordering of leaf nodes and labels of leaf nodes are known. My goal (and means of…
davnovak
  • 57
  • 6
1
vote
0 answers

Does order of data matter?

I am using R to perform hierarchical clustering to categorical data. I am trying out different variables from my sample, in order to identify the ones that provide meaningful clustering results. However, I noticed that if I change the order of the…
Anna
  • 177
  • 13
1
vote
1 answer

The leaf's labels aren't showing completely when I use as.dendrogram

When I plot the dendrogram using "as.dendrogram" all the leaf labels are cut. See those linked images below as examples: When I plot using "hclust" (all labels showing correctly) Dendrogram 1 When I plot using "as.dendrogram" Dendrogram 2 Codes:…
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

Sensitivity of hierarchical clustering solution in r

I'm using hierarchical clustering to pull out a set number of clusters from a dataset. My objective is to test how robust the clustering solution is when I reduce the amount of data used (and potentially the variables included). I think this means…
1
vote
1 answer

How to cluster around 9000 sequences of numbers using R?

I have a csv file containing around 9000 number sequences which I need to cluster. The first 6 rows of the csv look like this id, sequence "1","1 2" "2","3 4 5 5 6 6 7 8 9 10 11 12 13 8 14 10 10 15 11 12 16" "3","17 18 19 20 5 5 20 5 5" "4","20…
Shamsa
  • 67
  • 1
  • 8
1
vote
1 answer

Why is hclust showing an inversion here?

Here are three points and a hierarchical clustering using hclust in R with the "centroid" method. points <- data.frame(x = c(0, 1, 0.75), y = c(0, 0, 1)) centroid <- hclust(dist(points), method = "centroid") plot(centroid) The…
Sean Raleigh
  • 579
  • 4
  • 10
1
vote
1 answer

How to label nodes of a dendrogram with mathematical symbols?

I am doing cluster analysis on some set of mathematical objects. The basic R has the functionality to plot mathematical symbols. I want to label nodes of my dendrogram with some mathematical symbols. How to incorporate this in plot function for…
Piotr Wilczek
  • 187
  • 1
  • 1
  • 10
1
vote
1 answer

Is it possible to run a clustering algorithm with chunked distance matrices?

I have a distance/dissimilarity matrix (30K rows 30K columns) that is calculated in a loop and stored in ROM. I would like to do clustering over the matrix. I import and cluster it as…
A. Bek
  • 21
  • 1
1
vote
0 answers

How to extract node position from boot.hclust object (pvclust)?

I know I can obtain the au/bp number from the final object from pvclust, but I could not figure out which of the samples or edges are associated with it. What I am trying to do is to assign the au value to the samples. Thanks! data(lung) lung.pv <-…
SplitInf
  • 76
  • 4
1
vote
1 answer

R hclust: common order for multiple trees

I am making trees using hclust. I have several distances defined on a common set. I want to find, as close to possible, a common order of the set for each distance without any crossing edges in the plot. For example, I would like to have the 1…
FScott
  • 41
  • 5
1
vote
0 answers

Possible bug in the function hclust() of R-Project

Hi my frinds the observation is the following. I don't know what the problem is. When I am making clusters with the hclust function, the labels of the object that it creates are lost if the way I subset the data frame is "incorrect". This is the…
alebj88
  • 71
  • 1
  • 5
1
vote
1 answer

Selecting clusters below a certain height in a dendrogram R but only if the cluster is bigger than one

I'm looking to write some simple code that will select for certain clusters below a threshold height and highlight them (either with a box or by colour). So far I have used cutree, which selects the clusters I am after, but it also selects all the…
1
vote
1 answer

keep the observation belonging to the cluster in R

Simple example with iris dataset. I must use apcluster library library("apcluster") #use dist() create a negative SimilarityMatrix sim<-negDistMat(iris[,1:4],r=2) #run the clusteralgorythm and create apclustert object…
psysky
  • 3,037
  • 5
  • 28
  • 64