get_n_lineages {nLTT} | R Documentation |
Collect the number of lineages from the stem age
get_n_lineages(phylogeny)
phylogeny |
a phylogeny of class 'phylo' |
number of lineages, will go from 1 to the number of tips, if there is a stem, will go from 2 to the number of tips if there is no stem
Richèl Bilderbeek
phylogeny <- ape::read.tree(text = "((a:2,b:2):1,c:3);")
all.equal(as.vector(nLTT::get_n_lineages(phylogeny)), c(2, 3))
phylogeny$root.edge <- 2 # nolint ape variable name
all.equal(as.vector(nLTT::get_n_lineages(phylogeny)), c(1, 2, 3))