----- Forwarded message from Paolo Piras <paolo.pi...@uniroma3.it> -----

Date: Fri, 10 May 2013 04:36:26 -0400
From: Paolo Piras <paolo.pi...@uniroma3.it>
Reply-To: Paolo Piras <paolo.pi...@uniroma3.it>
Subject: RE: Cluster analysis
To: "morphmet@morphometrics.org" <morphmet@morphometrics.org>

phangorn package (and other tons of packages) do that in R

I wrote a function that takes a matrix and a factor and performs cluster analysis (both UPGMA and NJ are displayed) using  per-level means.


clusteronmeans<-function(x,group){
library(MASS)
library(car)
library(phangorn)
group2<-group[order(group)]
x2<-x[order(group),]

x3<-aggregate(x2,by=list(group2),FUN=mean)
rownames(x3)<-levels(group2)

x11()
plot(upgma(as.matrix(dist(x3[,-1],method="euclidean"))))
par(new=T)
title(main="upgma")

x11()
plot(nj(as.matrix(dist(x3[,-1],method="euclidean"))))
par(new=T)
title(main="neighbor-joining")
}


let me know if this helps

best

paolo










Da: morphmet_modera...@morphometrics.org [morphmet_modera...@morphometrics.org]
Inviato: venerdì 10 maggio 2013 10.23
A: morphmet@morphometrics.org
Oggetto: Re: Cluster analysis


----- Forwarded message from Saber Sadeghi <sabersade...@yahoo.com> -----

Date: Thu, 9 May 2013 03:13:00 -0400
From: Saber Sadeghi <sabersade...@yahoo.com>
Reply-To: Saber Sadeghi <sabersade...@yahoo.com>
Subject: Re: Cluster analysis
To: morphmet@morphometrics.org

Dear Dan
NTSYSpc is a good software for UPGMA, but it's not free.
success
saber

--- On Fri, 5/3/13, morphmet_modera...@morphometrics.org <morphmet_modera...@morphometrics.org> wrote:

From: morphmet_modera...@morphometrics.org <morphmet_modera...@morphometrics.org>
Subject: Cluster analysis
To: morphmet@morphometrics.org
Date: Friday, May 3, 2013, 9:50 AM


----- Forwarded message from dan kin <d...@walla.com> -----

Date: Thu, 2 May 2013 14:13:54 -0400
From: dan kin <d...@walla.com>
Reply-To: dan kin <d...@walla.com>
Subject: Cluster analysis
To: morphmet@morphometrics.org



Hi,

 

I wish to perform cluster analysis (e.g., UPGMA) on a TPS file.  What are the options I have, how do I do it and which softwares/packages can execute this task?


Thank,

Dan




----- End forwarded message -----





----- End forwarded message -----





----- End forwarded message -----



Reply via email to