| del.node {phybase} | R Documentation |
This function deletes a node (and its descendant nodes) from the tree.
del.node(inode, name, nodematrix)
inode |
the node to be deleted |
name |
the species names |
nodematrix |
the tree node matrix |
The species names are those defined in the original tree before deleting the node inode. No need to delete the species name of inode! If inode is an internode, the whole subtree below inode will be deleted.
nodes |
the tree node matrix after deleting inode |
treestr |
the tree string of the tree after deleting inode. |
Liang Liu
treestr<-"((((H:0.00402,C:0.00402):0.00304,G:0.00707):0.00929,O:0.01635):0.1,W:0.12);"
spname<-read.tree.nodes(treestr)$names
nodematrix<-read.tree.nodes(treestr)$nodes
del.node(6,spname,nodematrix)
##unrooted tree
data(unrooted.tree)
nodematrix<-read.tree.nodes(unrooted.tree[1])$nodes
name<-paste("S",1:29,sep="")
del.node(6,name,nodematrix)