## Creates a random tree of class phylo4
tree <- rtree4(50)
## Label the nodes of a tree by their nodeId
labelledTree <- idNodeLabel(tree)
plot(labelledTree,show.tip.label=FALSE,show.node.label=TRUE)
## Find the number of tip children of a node
nTipChildren(tree,70)
## Checks that the tree is of the correct type
phyloCheck(tree)
Run the code above in your browser using DataLab