Skip to content
Prev 359558 / 398502 Next

Export the result k-means cluster to CSV file

Hello Everyone :?i have ?done the clustering ?process by k-means cluster, then i try to save[Export ] the groups of clustering, to txt, or CSV files , how i can do that #########################################clusrer.data <- function(data,n) {
miRNA.exp.cluster <- scale(t(miRNA.exp))
k.means.fit <- kmeans(miRNA.exp.cluster,n)k.means.fit#i try to save the results of k-means cluster by this code :?
k.means.fit <- as.data.frame(k.means.fit)write.csv(k.means.fit, file="k-meanReslut.csv")

#x<-k.means.fit$clusters#write.csv(x, file="k-meanReslut.csv")

}
the result:K-means clustering with 5 clusters of sizes 8, 6, 7, 20, 18
####################33

thanks for all.
??