[R] Export the result k-means cluster to CSV file
hehsham alpukhity
heshamibb at yahoo.com
Thu Mar 24 13:08:38 CET 2016
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.
[[alternative HTML version deleted]]
More information about the R-help
mailing list