change.root {phybase} | R Documentation |
The function changes the tree root.
change.root(nodematrix, newroot)
nodematrix |
the tree node matrix |
newroot |
the node number of the new root |
The function always returns an unrooted tree. Use the function link{root.tree}
to root the unrooted tree if you need a rooted tree.
nodes |
the tree node matrix after changing the tree root |
rootnode |
the node number of the new root |
Liang Liu lliu@oeb.harvard.edu
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)