0

for my undergraduate research project, I'm looking for an R code for agglomerative clustering. Basically, I need to know what happened inside hclust method in R. I have looked everywhere but don't find a proper way to combine 2 data points that have the smallest distance. I was stuck at developing a dissimilarity matrix after the first phase of dissimilarity matrix generation(literally I have generated the first dissimilarity matrix). I'm not specifying R, if anyone could give me a solution in any language I would gratefully accept that.

sample from the dataset

  • Hi Denam, it would be very helpfull if you provide a glimpse of your data set (eg with `dput(head(your_dataset, 10))`. Also provide an concrete example of what you would like to achieve or what you mean by **combine** 2 data points that have the smallest distance. It is easier to find answers when we can work with concrete examples. – Marcelo Avila Mar 22 '21 at 14:55
  • Hi Marcelo, Thanks for the quick response. So I have used Gower method to generate dissimilarity matrix. then using that matrix I want to get the data points which have smallest distance and put them into a one cluster. Now the problem is with how to calculate distance with other data points and this generated cluster (because now the cluster have 2 data points and how to get the distance from that). I think getting the centroid is one method. I'm not sure on those. – Denam Demian Mar 22 '21 at 15:31
  • it will improve your changes of getting a good response if you provide more info on what you've tried and achieved so far and where exactly you are stuck.. (and also an example of what you want to get. Have a look here (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and try to apply most of that to your answer. I am sure then someone will be able to help you. – Marcelo Avila Mar 22 '21 at 15:46

0 Answers0