[R] plotting radial dendrograms

From: Carson Farmer <carson.farmer_at_gmail.com>
Date: Thu, 17 Jun 2010 12:50:28 +0100


Dear list,

I am trying to plot a radial dendrogram using the ape package, which requires my data to be of class 'phylo'. Currently I have my dendrogram stored as an object of class 'dendrogram' which was produced from an outside bit of C code, but was made into an object of class 'igraph.eigenc' and converted to a dendrogram using 'as.dendrogram()' from the igraph package. I would like to find a way to convert this dendrogram to a 'phylo' object, either directly, or through conversion via 'hclust'. I have tried creating an 'hclust' object 'manually' but keep running into "Error: segfault from C stack overflow" when I try to plot it:

> result <- list()
> result$merge<-merges
> result$method <- NULL
> result$dist.method <- "modularity"
> result$height <- seq(length(merges[,1]),1,-1)
> result$order <- seq(length(merges[,1])+1)
> result$call <- "some call"
> class(result) <- "hclust"
> plot(result)

where merges is a two column matrix of cluster joins that looks something like this:

> merges

     [,1] [,2]
[1,] 0 2
[2,] 3 1

The dendrogram object was created using something like this:

> result <- list()
> class(result) <- "igraph.eigenc"
> result$merges <- merges
> result$membership <- membership
> dend <- as.dendrogram(result)

where merges is as above, and membership is:

> membership

[1] 0 0 0 0 0 2 2 2 2 2 1 1 1 1 1

Any thoughts on how to convert a dendrogram object to an hclust or phylo object, or barring that, another way to plot a radial dendrogam in R?

Regards,

Carson

-- 
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation
National University of Ireland, Maynooth,
http://www.carsonfarmer.com/

______________________________________________
R-help_at_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.
Received on Thu 17 Jun 2010 - 11:56:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jun 2010 - 14:10:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive