powered by
nnodes(x, ...) "nnodes"(x, ...) "nnodes"(x, ...) "nnodes"(x, ...)
The phylo method is based on turning the phylo to hclust and than to dendrogram. It may not work for complex phylo trees.
hc <- hclust(dist(USArrests[1:5,]), "ave") dend <- as.dendrogram(hc) nnodes(dend) # 9 nnodes(hc) # 9
Run the code above in your browser using DataLab