I've done a k-means clustering on my data, imported from .csv. Is there anyway to export the clustered results back to .csv file? Cos after the k-means clustering is done, the class of the variable is not a data frame but kmeans.
Asked
Active
Viewed 9,257 times
1 Answers
3
In most R package help files there will be a subheading that says "value" that describes the output from the analyses conducted. I have not used kmeans recently, but I believe you want something like this:
kmeansresults<-kmeans(dataframe)
x<-kmeansresults$clusters
write.csv(x, file="name_of_file.csv")

Chris Bail
- 307
- 1
- 8
-
Thanks for the answer. Also I'd like to work out the central point of each cluster. How can I do that? – Anh Nguyen Apr 09 '15 at 00:21