1

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.

NobodyNada
  • 7,529
  • 6
  • 44
  • 51
Anh Nguyen
  • 27
  • 2
  • 8

1 Answers1

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