treeSlice: Slices the tree at a particular point and returns all...

View source: R/treeSlice.R

treeSliceR Documentation

Slices the tree at a particular point and returns all subtrees, or the tree rootward of the point

Description

Cut (or slice) a phylogenetic tree at a particular time point.

Usage

treeSlice(tree, slice, trivial=FALSE, prompt=FALSE, ...)

Arguments

tree

is a phylogenetic tree in "phylo" format.

slice

a real number indicating the height above the root at which to slice the tree.

trivial

a logical value indicating whether or not to return subtrees with a number of tips less than two (default is FALSE).

prompt

logical value indicating whether or not the height of the slice should be given interactively.

...

for prompt=TRUE, other arguments to be passed to plotTree. In addition, the argument orientation can be used to specify whether the "tipwards" subtrees or the "rootwards" phylogeny are/is to be returned by the function call (using those two argument values, respectively).

Details

This function slices a tree at a particular height above the root and returns all subtrees or all non-trivial subtrees (i.e., subtrees with more than 1 taxon). Uses extract.clade in the ape package.

treeSlice can also be used to crop the terminal fraction of a tree for orientation="rootwards".

Value

An object of class "phylo" or "multiPhylo".

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

extract.clade


liamrevell/phytools documentation built on March 4, 2024, 3:27 a.m.