int.node: Bind a tip above a node

Description Usage Arguments Value Author(s) Examples

View source: R/int.node.R

Description

This functions binds a tip to an interior branch above a node, and creates a node.

Usage

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

Arguments

phylogeny

The phylogeny.

location.node

The number or label of the node above which the tip is to bind.

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 interior branch to bind the new tip, the value must be > 0 and < 1, meaning the proportion of the interior branch length starts from location.node. The default is 0.5.

Value

phylogeny

The updated 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 <- int.node(phylogeny = phylo0, location.node = sample(phylo0$edge[, 1], 1), tip.label = "New Tip", node.label = NULL, position = 0.5)    # bind a "New Tip" to the phylogeny to a branch above a random node.
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.