Here is a draft solution with the built in example:<br><br>library(adegenet)<br>data(H3N2)<br>pop(H3N2) <- factor(H3N2$other$epid)<br>dapc1 <- dapc(H3N2, all.contrib=FALSE, scale=FALSE, n.pca=150, n.da=5)<br><br>hc <- hclust(dist(dapc1$grp.coord))<br>
dend <- as.dendrogram(hc)<br>plot(dend)<br><div><br></div><div><br></div><div>HTH,<br></div><div>
Vladimir</div><div><br><span style="color:rgb(102, 102, 102)">--</span><br><font style="color:rgb(102, 102, 102)" color="#888888">Vladimir Mikryukov<br></font><span style="color:rgb(102, 102, 102)">PhD student</span><br style="color:rgb(102, 102, 102)">
<font color="#888888"><font color="#888888"><font color="#888888"><font color="#888888"><font color="#888888"><font color="#888888">
<span style="color:rgb(102, 102, 102)">Institute of Plant & Animal Ecology UD RAS,</span><br style="color:rgb(102, 102, 102)">
<span style="color:rgb(102, 102, 102)">Lab. of Population and Community Ecotoxicology</span><br style="color:rgb(102, 102, 102)"><span style="color:rgb(102, 102, 102)">[8 Marta 202, 620144, Ekaterinburg, Russia]</span></font></font></font></font></font><br style="color:rgb(102, 102, 102)">
<span style="color:rgb(102, 102, 102)">Tel. +7 343 210 38 58 (ext.290), +7 922 61 36 8</span></font>
<br></div><div><br></div><div class="gmail_quote">On Fri, Apr 29, 2011 at 10:10 PM, Mac Campbell <span dir="ltr"><<a href="mailto:macampbell2@alaska.edu" target="_blank">macampbell2@alaska.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi ,<div><br><div>I was looking at another grad students clustering analysis, and he displayed it as a tree. It was some sort of ecological data. Anyways, I thought it might be useful to compare groups identified through DAPC that way. Display them graphically using adegenet, but also provide some sort of tree as a hypothesis of relationships. It would seem to me that this could already by done in R without the need to develop anything new. Does anybody have an idea how to take output from dapc and make a tree?<br>
<br>Mac</div><div><br></div><div><br clear="all"><br>-- <br>Matthew A Campbell<br>Department of Biology and Wildlife<br>University of Alaska, Fairbanks<br>
</div></div>
<br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br></blockquote></div><br>