Learn R Programming

TreeSearch (version 0.2.2)

AddTip: Add a tip to a phylogenetic tree

Description

AddTip adds a tip to a phylogenetic tree at a specified location.

Usage

AddTip(tree, where, label)

Arguments

tree

A tree of class phylo.

where

The node or tip that should form the sister taxon to the new node. To add a new tip at the root, use "where = 0";

label

A character string providing the label the new tip.

Value

This function returns a tree of class phylo with an additional tip at the desired location.

Details

AddTip extends bind.tree, which cannot handle single-taxon trees.

See Also

bind.tree

nodelabels

Examples

Run this code
# NOT RUN {
{
  library('ape')
  plot(tree <- rtree(10, br=NULL)); nodelabels(); nodelabels(15, 15, bg='green'); dev.new()
  plot(AddTip(tree, 15, 'NEW_TIP'))
}
# }

Run the code above in your browser using DataLab