if (requireNamespace("ape")) {
par(mar = c(0, 0, 0, 0))
# "fan"
mytr <- ape::read.tree(text = newick_string(level = "suborder"))
plot(mytr, "f", rotate.tree = 180, cex = 0.75)
# "cladogram"
mytr <- ape::read.tree(text = newick_string("durixeralfs", level = "subgroup"))
plot(mytr, "c")
# "cladogram" (using taxon codes instead of subgroups)
mytr <- ape::read.tree(text = newick_string("xeralfs", level = "subgroup", what = "code"))
plot(mytr, "c")
dev.off()
}
Run the code above in your browser using DataLab