write.subtree: Write a sub-tree into a string

write.subtreeR Documentation

Write a sub-tree into a string

Description

write a tree or a sub-tree into a string in parenthetical format

Usage

write.subtree(inode, nodematrix,taxaname,root,print.support=FALSE)

Arguments

inode

the root node of a sub-tree

nodematrix

a tree node matrix

taxaname

taxa names

root

the root node of a sub-tree

print.support

print out support values if print.support=TRUE

Details

If inode is the root of the tree, the function will write the whole tree into a string in parenthetical format. If inode is not the root node, the function will write the sub-tree into a string. The function works for both rooted trees and unrooted trees.

Value

The function returns a tree string in parenthetical format

Author(s)

Liang Liu lliu@uga.edu

See Also

write.tree.string, read.tree.nodes

Examples

data(dat.coaltree)
tree<-read.tree.nodes(dat.coaltree$sptree)
tree$nodes
tree$names
write.subtree(7,tree$nodes,tree$names,7)

lliu1871/phybase documentation built on April 21, 2024, 3:16 a.m.