ext.node: Bind a tip to a terminal branch

Description Usage Arguments Value Author(s) Examples

View source: R/ext.node.R

Description

This functions binds a tip to a terminal branch in a phylogeny, and creates a node.

Usage

1
ext.node(phylogeny, location.tip, tip.label, node.label = NULL, position = 0.5)

Arguments

phylogeny

The phylogeny.

location.tip

The number or label of the tip of the terminal branch.

tip.label

The label of the tip to bind.

node.label

The label of the node created when binding the tip. The default is NULL.

position

The position on the terminal branch to bind the tip, the value must be > 0 and < 1, meaning the proportion of the terminal branch length starts from the tip. The default is 0.5.

Value

phylo

The phylogeny with the tip binded.

Author(s)

Yi Jin

Examples

1
2
3
4
5
6
library(ape)
phylo0 <- rcoal(10)   # generate a phylogeny with 10 tips
phylo <- ext.node(phylogeny = phylo0, location.tip = sample(1:10, 1), tip.label = "New Tip", node.label = NULL, position = 0.5)   # bind a "New Tip" to a random terminal branch.
par(mfrow=c(1,2))
plot(phylo0)    # plot the phylogeny.
plot(phylo)     # plot the phylogeny with the "New Tip" binded.

jinyizju/V.PhyloMaker documentation built on July 12, 2021, 12:15 a.m.