# Create simple two-cherry tree:
tree <- ape::read.tree(text = "((A,B),(C,D));")
# Show count of cherries is two:
count_cherries(tree = tree)
# Create a star tree:
tree <- ape::read.tree(text = "(A,B,C,D);")
# Show count of cherries is zero:
count_cherries(tree = tree)
Run the code above in your browser using DataLab