nni {phangorn}R Documentation

Tree rearrangements.

Description

nni returns a list of all trees which are one nearest neighbor interchange away. rNNI and rSPR are two methods which simulate random trees which are a specified number of rearrangement apart from the input tree. Both methods assume that the input tree is bifurcating. These methods may be useful in simulation studies.

Usage

nni(tree)
rSPR(tree, moves=1, n=1)
rNNI(tree, moves=1, n=1)

Arguments

tree A phylogenetic tree, object of class phylo.
moves Number of tree rearrangements to be transformed on a tree.
n Number of trees to be simulated.

Value

an object of class multiPhylo.

Author(s)

Klaus Schliep klaus.schliep@gmail.com

Examples

tree = unroot(rtree(20))
trees1 <- nni(tree)
trees2 <- rSPR(tree, 2, 10)

[Package phangorn version 0.99-6 Index]