cutPhylo function

Cut the phylogeny at a given age or node

Cut the phylogeny at a given age or node

The function cuts all the branches of the phylogeny which are younger than a specific age or node (i.e. the age of the node).

cutPhylo(tree,age=NULL,node=NULL,keep.lineage=TRUE)

Arguments

  • tree: a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous.
  • age: the age (in terms of time distance from the recent) at which the tree must be cut
  • node: the node whose age must be used as cutting limit.
  • keep.lineage: logical specifying whether lineages with no descendant tip must be retained (see example below). Default is TRUE.

Returns

The function returns the cut phylogeny and plots it into the graphic device. The time axis keeps the root age of the original tree. Note, tip labels are ordered according to their position in the tree.

Details

When an entire lineage is cut (i.e. one or more nodes along a path) and keep.lineages = TRUE, the leaves left are labeled as "l" followed by a number.

Examples

## Not run: library(ape) set.seed(22) rtree(100)->tree 3->age cutPhylo(tree,age=age)->t1 cutPhylo(tree,age=age,keep.lineage=FALSE)->t1a cutPhylo(tree,node=151)->t2 cutPhylo(tree,node=151,keep.lineage=FALSE)->t2a ## End(Not run)

See Also

c("list("cutPhylo")", "\n", " vignette")

Author(s)

Pasquale Raia, Silvia Castiglione, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto

  • Maintainer: Silvia Castiglione
  • License: GPL-2
  • Last published: 2025-03-23

Useful links