at.node: Bind a tip to a node

Description Usage Arguments Value Author(s) Examples

View source: R/at.node.R

Description

This function binds a tip to a node and creates a polytomy

Usage

1
at.node(phylogeny, location.node, tip.label)

Arguments

phylogeny

The phylogeny.

location.node

The number or label of the node to bind.

tip.label

The label of the tip.

Value

Returns the phylogeny with the tip binded to the node.

Author(s)

Yi Jin

Examples

1
2
3
4
5
6
library(ape)
phylo0 <- rcoal(10)  # generate a phylogeny with 10 tips
phylo <- at.node(phylogeny = phylo0, location.node = sample(phylo0$edge[, 1], 1), tip.label = "New Tip")  # bind a "New Tip" to the phylogeny at 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.