cutPhylo: Cut the phylogeny at a given age or node

View source: R/cutPhylo.R

cutPhyloR Documentation

Cut the phylogeny at a given age or node

Description

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).

Usage

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.

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.

Value

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.

Author(s)

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

See Also

cutPhylo vignette

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)->t1
cutPhylo(tree,node=151)->t2
cutPhylo(tree,node=151,keep.lineage=FALSE)->t2

## End(Not run)

RRphylo documentation built on June 7, 2023, 5:49 p.m.