get_n_lineages: Collect the number of lineages from the stem age

Description Usage Arguments Value Author(s) Examples

View source: R/get_n_lineages.R

Description

Collect the number of lineages from the stem age

Usage

1
get_n_lineages(phylogeny)

Arguments

phylogeny

a phylogeny of class 'phylo'

Value

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

Author(s)

Richel Bilderbeek

Examples

1
2
3
4
5
6
  phylogeny <- ape::read.tree(text = "((a:2,b:2):1,c:3);")
  testthat::expect_true(
    all(nLTT::get_n_lineages(phylogeny) == c(2, 3)))
  phylogeny$root.edge <- 2 # nolint ape variable name
  testthat::expect_true(
    all(nLTT::get_n_lineages(phylogeny) == c(1, 2, 3)))

nLTT documentation built on Jan. 13, 2020, 9:06 a.m.