R function from {stats} package - hierarchical cluster analysis on a set of dissimilarities and methods for analyzing it.
Questions tagged [hclust]
176 questions
0
votes
1 answer
Draw polygons around clusters from hclust
I did clustering by using function hclust, now I want to draw polygons around each cluster!
How I can do it? I only have a group of point with the cluster id!
for example this image has two classes and 4 distinct areas! How I can get the number of…

Oumnia Asadian
- 39
- 8
0
votes
1 answer
Error in NbClust: not enough objects to cluster
I am trying to use the NbClust method in R to determine the best number of clusters in a cluster analysis following the approach in the book from Manning.
However, I get an error message saying:
Error in hclust(md, method = "average"): must have n…

Hannah H.
- 266
- 3
- 14
0
votes
1 answer
Pre-defining clusters in r
I have a pretty big data table (about 100.000 observations) that I'd like to use for clustering. Since some of the data is categorical, I've tried using "gower distance" and then hclust() with the "ward" method.
The data itself is very…

Anna
- 3
- 5
0
votes
1 answer
Obtaining cluster hierarchy and nested cluster assignments
I am currently looking into hierarchy in the topics of documents. As a first step I find a vector representation of my documents, after which I use hierarchical clustering to determine whether there are topics within topics of the document. I want…

BDP1
- 23
- 4
0
votes
1 answer
Different results for `hclust' and `agnes' using average link
I am applying a simple clustering procedure to a custom simulated similarity matrix. (https://github.com/ewouddt/Files/blob/master/sim_col.RData)
However I am noticing a difference between the hclust and agnes procedure when using an average link…

Ewoud
- 217
- 2
- 11
0
votes
1 answer
How to create a vector with the variables to use in hclust
I'm using the hclust function in a large script applied to a df like in this example:
HClust <- hclust(d = dist(model.matrix(~-1 + A + B + C + D, df))^2, method = "centroid")
I would like to specify only once the variables in the df, eg. MgO, Zn,…

Esteful
- 23
- 4
0
votes
1 answer
Get indices of cutree of hclust
Its a very basic question, unfortunately I do not know how to ask it.
Lets say I have the following code for clustering using hclust:
hc <- hclust(dist(USArrests), "ave")
s = cutree(hc,k=2)
Lets assume sort(s) gives the following result:
Alabama…

motiur
- 1,640
- 9
- 33
- 61
0
votes
1 answer
Specifying number of clusters in R
Is there a way in R to determine the number of clusters generated without manually specifying it?
After doing some extraction of 'letters' from string values, I subjected my variable with 30000 distinct values into clusters for me to determine…

icychamp
- 70
- 8
0
votes
1 answer
r: error for NbClust() call when deploying it within for() loop - "Error in if ((res[ncP - min_nc + 1, 15] <= resCritical[ncP - min_nc + :"
I want to call the NbClust() function for a couple of dataframes. I do so by "sending" them all through a for loop that contains the NbClust() function call.
The code looks like this:
#combos of just all columns from df
variations =…

Jonathan Rhein
- 1,616
- 3
- 23
- 47
0
votes
2 answers
Using cluster.stats with hclust
I have a problem using cluster.stats on two different hclust clusters. Is that not possible?
I am on Version 0.99.491 – © 2009-2015 RStudio, Inc.
with below packages installed:
mylib <- "/Users/Klaus/R Packages/";…
0
votes
1 answer
cluster attributes using hclust in R
I have a data set which is two dimensional data with column names as attributes and rows as items. A sample is given below:
A1 A2 A3 A4 ....
Item1 0 1 0 0
Item2 0 0 0 1
Item3 1 1 0 0
....
I have…

user2076038
- 3
- 2
0
votes
0 answers
R-Calculate the distance between dataframe elments without using dist() function
I have a large dataset (~188000 rows), I want to calculate the distance between my rows so I can then apply the hclust function to determine the centers of my dataset and later apply the kmeans function to classify my data.
My problem is with the…

sarah
- 229
- 5
- 13
0
votes
1 answer
Hierarchical Clustering in R - 'pvclust' Issues
I have made a reproducible example where I am having trouble with pvclust. My goal is to pick the ideal clusters in a hierarchal cluster dendogram. I've heard of 'pvclust' but can't figure out how to use it. Also if anyone has other suggestions…

analytics
- 149
- 1
- 9
0
votes
1 answer
Clustering For PPI (protein protein interaction) network
i want to cluster the protein interaction database, into sub cluster
and for that I used Hierarchical Clustering in R. But i get warning message which i can't understand and cluster would not created. My code and Database are as below:
Database:
…

priyanka nimavat
- 97
- 1
- 8
0
votes
1 answer
Cluster analysis, dendrogram by group/habitat not sample
I cannot seem to find a thread relating to my issue (in simple terms at least).
I have a community matrix of species (columns) by sample sites (rows). I firstly performed a Bray-Curtis transformation to get a similarity/dissimilarity matrix…

Rion Lerm
- 19
- 5