[R] Save Cluster results to data frame
chrish at stats.ucl.ac.uk
Mon May 18 14:05:03 CEST 2009
this isn't particularly a clustering question, is it?
Why don't you just take your clustering vector
(pam.output.object$clustering) and assign it to
a$clustering (given that a is the name of your data frame)?
And why don't you just define a new character/string vector and assign
the cluster names that you want to it using if or case?
On Mon, 18 May 2009, Chris Arthur wrote:
> If I cluster my data into 3 sets, using pam for instance, is there a way
> to save the resultant cluster results, to the originating data frame. and
> related to that how do i say change the cluster names to something a bit
> more meaningful that 1..2...3
> So it goes like this.
> Data ---> Cluster into 3 groups ----> given them meaningful names
> back to data frame
> Thanks for the help
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
*** --- ***
University College London, Department of Statistical Science
Gower St., London WC1E 6BT, phone +44 207 679 1698
chrish at stats.ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche
More information about the R-help