[R] Save Cluster results to data frame

2009-05-18 Thread Chris Arthur
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

---output back to data frame


Thanks for the help

Chris

__
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.


Re: [R] Save Cluster results to data frame

2009-05-18 Thread Christian Hennig

Hi Chris,

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?

Regards,
Christian

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
   ---output 
back to data frame


Thanks for the help

Chris

__
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.



*** --- ***
Christian Hennig
University College London, Department of Statistical Science
Gower St., London WC1E 6BT, phone +44 207 679 1698
chr...@stats.ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche

__
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.