getPath: Get path between nodes

Description Usage Arguments Details See Also Examples

View source: R/get-spcl-methods.R

Description

Return node ids for connecting from to to.

Usage

1
getPath(tree, from, to)

Arguments

tree

TreeMan object

from

starting node id

to

ending node id

Details

Returns a vector, first id is from to to.

See Also

https://github.com/DomBennett/treeman/wiki/get-methods

Examples

1
2
3
4
5
6
library(treeman)
data(mammals)
# what's the phylogenetic distance from humans to gorillas?
ape_id <- getPrnt(mammals, ids=c('Homo_sapiens', 'Hylobates_concolor'))
pth <- getPath(mammals, from='Homo_sapiens', to='Gorilla_gorilla')
sum(getNdsSlt(mammals, ids=pth, slt_nm='spn'))

treeman documentation built on July 8, 2020, 7:28 p.m.