I am using ape (Analysis of Phylogenetics and Evolution) package in R that has dendrogram drawing functionality. I use following commands to read the data in Newick format, and draw a dendrogram using the plot function:
library("ape")
gcPhylo <-read.tree(file = "gc.tree")
plot(gcPhylo, show.node.label = TRUE)
As the data set is quite large, it is impossible to see any details in the lower levels of the tree. I can see just black areas but no details. I can only see few levels from the top, and then no detail.
I was wondering if there is any zoom capability of the plot function. I tried to limit the area using xLim and yLim, however, they just limit the area, and do not zoom to make the details visible. Either zooming, or making the details visible without zooming will solve my problem.
I am also appreciated to know any other package, function, or tool that will help me overcoming the problem.
Thanks.
Best Answer
It is possible to
cut
a dendrogram at a specified height and plot the elements:First create a clustering using the built-in dataset
USArrests
. Then convert to adendrogram
:Next, use
cut.dendrogram
to cut at a specified height, in this caseh=75
. This produces a list of a dendrogram for theupper
bit of the cut, and a list of dendograms, one for eachbranch
below the cut: