Finds the sizes and positions of ladders in the tree. A ladder is here defined to be a series of consecutive nodes in the tree, each of which has exactly one tip child (as counted by ILnumber). The size of the ladder is given by the number of nodes in the chain.

ladderSizes(tree)

Arguments

tree

a tree of class phylo or phylo4. The tree should be binary and rooted; if not it will be coerced into a binary rooted tree using multi2di, if possible.

Value

A list of:

  • ladderSizes the sizes of ladders in the tree

  • ladderNodes the ladder nodes in the tree

  • ladderEdges the edges between ladder nodes of the tree

See also

Author

Caroline Colijn c.colijn@imperial.ac.uk

Michelle Kendall michelle.louise.kendall@gmail.com

Examples

## Find ladder sizes in a random tree with 20 tips:
tree <- rtree(20)
plot(tree)

ladderSizes(tree)
#> $ladderSizes
#> [1] 2
#> 
#> $ladderNodes
#> [1] 29 30
#> 
#> $ladderEdges
#> [1] 17
#> 
# note that the ladders can be highlighted in a plot using ladderShow:
ladderShow(tree)