Re: [R] exporting clustering results to table

2007-11-27 Thread Dave Roberts
Martin, The cutree() function returns the cluster membership as a vector. To get a similar result from pam() (and other functions in library cluster) you need to extract the component $clustering, e.g. > clustersA <- pam(distances, nkA, diss=TRUE) > filenameclu = paste("filenameclu", ".t

Re: [R] exporting clustering results to table

2007-11-27 Thread Martin Tomko
Hello Haris, no, that is not the problem. But thank you anyway. I figured that paste has a funny behavior. But the object resulting from pam is complex, and cannot be cast into a table frame easily... Charilaos Skiadas wrote: > On Nov 27, 2007, at 7:41 AM, Martin Tomko wrote: > >> filename = p

[R] exporting clustering results to table

2007-11-27 Thread Martin Tomko
Hello list, the following approach did not work: clustersA <- pam(distances, nkA, diss=TRUE); gc(); filenameclu = paste("filenameclu", ".txt"); write.table(clustersA , file=filenameclu,sep=","); although it worked with clustersA <- hclust(distances, method="ward"); and a consecutive kclassA <- c