change.root {phybase}R Documentation

Change tree root

Description

The function changes the tree root.

Usage

change.root(nodematrix, newroot)

Arguments

nodematrix the tree node matrix
newroot the node number of the new root

Details

The function always returns an unrooted tree. Use the function link{root.tree} to root the unrooted tree if you need a rooted tree.

Value

nodes the tree node matrix after changing the tree root
rootnode the node number of the new root

Author(s)

Liang Liu lliu@oeb.harvard.edu

See Also

root.tree, rootoftree

Examples

treestr<-"((((H:0.00402,C:0.00402):0.00304,G:0.00707):0.00929,O:0.01635):0.1,W:0.12);"
nodematrix<-read.tree.nodes(treestr)$nodes
change.root(nodematrix,6)

[Package phybase version 1.1 Index]