1buzz
1buzz

Reputation: 19

How to export hclust cluster results

I'm new to R but I've been stuck on this issue for weeks now. I have a data set of 343 observations and 28 columns. The first of these 28 columns is an identifier. Before running my analysis, I omitted that ID column using newdata <- olddata[,2:28] , and then proceeded to run cluster analysis. I got my results and everything looks good; But now, I want to recover the identifier and export it as a text file along with, at least, each observation's identifier and their corresponding cluster number. This a set of spatial data and need to put back into a GIS to map it. This was fairly easy to do when I was using k-means, but I have no clue how to do it with the hclust results.

Upvotes: 1

Views: 518

Answers (1)

Tal Galili
Tal Galili

Reputation: 25326

You can look at the cutree function.

Upvotes: 1

Related Questions