I want to convert my phylogeny into a dendrogram so I can use it with dendextend in R to produce a tanglegram. I have made some progress but I keep encountering errors, see below:
library(ape)
library(dendextend)
Tree <- rtree(10, rooted=F)
Tree <- read.tree(file="clipboard", text=NULL)
# test <- as.dendrogram(Tree)
## Error in ape::as.hclust.phylo(object) : the tree is not ultrametric
Tree.ultra <- chronos(Tree)
# test <- as.dendrogram(Tree.ultra)
## Error in ape::as.hclust.phylo(object) : the tree is not rooted
Tree.ultra$root.edge <- 0
# test <- as.dendrogram(Tree.ultra)
## Error in ape::as.hclust.phylo(object) : the tree is not binary
This thread seems to be the closest to answering my issues but the workflow is different and Im not sure how to address this binary issue. I have tried using as.hclust, as.hclust.phylo and hclust.