Hi Klaus,
Thanks for the quick reply. Unfortunately I get the same problems. The
problem seems to be with the members attribute which returns numeric().
Cheers,
Jarrod
Quoting Klaus Schliep <klaus.schl...@gmail.com> on Mon, 25 Jul 2011
19:17:14 +0200:
Hello Jarrod,
try:
h.d<-as.hclust(reorder(multi2di(host.tree)))
as.dendrogram(h.d)
Maybe it works.
Regards,
Klaus
On 7/25/11, Jarrod Hadfield <j.hadfi...@ed.ac.uk> wrote:
Dear list,
I'm trying to convert a phylo object into a dendrogram object with
little success. host.tree is a rooted ultrametric tree with polytomies
stored as phylo object. The polytomies can be resolved to produce a
binary tree and this can be coerced into a hclust object:
h.d<-as.hclust(multi2di(host.tree))
However when converted to a dendrogram using as.dendrogram(h.d) the
dendrogram appears broken. str(as.dendrogram(h.d)) returns:
--[dendrogram w/ 2 branches and members at h = 96.1]
|--[dendrogram w/ 2 branches and members at h = 82.8]
| |--[dendrogram w/ 2 branches and members at h = 70.3]
| | |--[dendrogram w/ 2 branches and members at h = 39]
| | | |--[dendrogram w/ 2 branches and members at h = 24.5]
Error in class(val) <- cl : attempt to set an attribute on NULL
I have given the zero branch lengths from the polytomies non-zero
branch lengths, but this does not seem to work either.
Any help would be gratefully received.
Jarrod Hadfield
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
--
Klaus Schliep
Université Paris 6 (Pierre et Marie Curie)
9, Quai Saint-Bernard, 75005 Paris
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo