Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

miscUtils

Low-level auxiliary functions for adephylo


Description

These hidden functions are utils for adephylo, used by other functions. Regular users can use them as well, but no validity checks are performed for the arguments: speed is here favored over safety. Most of these functions handle trees inheriting phylo4 class.

Usage

.tipToRoot(x, tip, root, include.root = FALSE)

Arguments

x

A valid tree of class phylo4.

tip

An integer identifying a tip by its numbers.

root

An integer identifying the root of the tree by its number.

include.root

a logical stating whether the root must be included as a node of the path from tip to root (TRUE), or not (FALSE, default).

Details

.tipToRoot finds the set of nodes between a tip and the root of a tree.

Value

.tipToRoot: a vector of named integers identifying nodes.

Author(s)

Thibaut Jombart tjombart@imperial.ac.uk

Examples

if(require(ape) & require(phylobase)){
## make a tree
x <- as(rtree(20),"phylo4")
plot(x,show.node=TRUE)

## .tipToRoot
root <- rootNode(x)
.tipToRoot(x, 1, root)
lapply(1:nTips(x), function(i) .tipToRoot(x, i, root))
}

adephylo

Exploratory Analyses for the Phylogenetic Comparative Method

v1.1-11
GPL (>= 2)
Authors
Thibaut Jombart <t.jombart@imperial.ac.uk>, Stéphane Dray <stephane.dray@univ-lyon1.fr>, Anders Ellern Bilgrau <abilgrau@math.aau.dk>
Initial release
2017-12-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.