Hi,

Just to inform you that I found the solution for the write.csv  task I
mentioned earlier. Searching thru the r-help leads me to this solution..

###Your soln starts
xx  <- max(cl2$cl.kmr10.cluster)
# find out how many clusters there are.
my.clusters <- list(NULL)  # set up an empty list for storage

#  Loop through the dataset and subset by cluster.
for(i in 1:xx) {
 my.clusters[[i]] <- subset(cl2,
cl2$cl.kmr10.cluster==i)
 }
# Eh voilĂ !
my.clusters


### Your solution ends

# Soln for writing the clustered results into multiple files using loop.


for(i in 1:xx) {
  write.csv(my.clusters[[i]], paste("mycluster",i,sep="."))
}



Regards

suhaila

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to