Look at the aggregate function to create a new data.frame in which you have M rows that have the means of the K variables for each group. Then use cluster analysis to cluster the M groups.
---------------------------------------------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Luna > Sent: Monday, May 14, 2012 8:51 AM > To: r-help > Subject: [R] How do I do group wise clustering in R? > > How do I do group wise clustering in R? > > Hi all, > > I have N x K data matrix, where N is the number of observations, K is > the > number of variables. > > The N observations fall into M categories or groups. > > Now I want to cluster the groups, instead of the observations, how do I > do > that? > > i.e. the clustering would be at the group level... > > Thanks a lot for your help! > > [[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. ______________________________________________ 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.