-
Notifications
You must be signed in to change notification settings - Fork 2
TreeMan class
TreeMan is an S4 class that consists of the following slots:
-
ndlstlist of nodes -
ndsvector of node IDs (nids) -
nndsnumber of nids -
tipsvector of tip IDs (tids) -
ntipsnumber of tids -
allvector of nids and tids -
nallnumber of nids and tids -
pdnumber, total span -
wspnlogical, with spans or not -
wtxnymslogical, with taxonyms or not -
plylogical, polytomous or not -
updtdlogical, slots up-to-date or not -
ndmtrxNULL orbigmemoryobject -
tindsvector of integers identifying nodes that are tips -
prindsvector of integers indicating the pre-node -
rootroot ID (rid) -
othr_slt_nmsvector of additional user-defined slots
All slots are updated whenever a set or manip method is used. Updating these slots is performed with the updateSlts() function. For certain functions, updating will not occur automatically and must be performed manually. It is not recommended that you ever print the ndlst to console (it can be very big). All the slots can be accessed using [] or @, which will be marginally faster. Note, nodes in the ndlst are lists and not Nodes.
In addition, there are pseudo-slots: 'spns', 'prids, 'ptids', 'txnyms' , ultr and age. All these slots are calculated upon being called. The first three use the getNdsSlt() function. In addition, any user defined slots can be extracted in this way. ultr and age will respectively determine whether the tree is ultrametric or calculate its age. These are calculated using the isUltrmtrc() and getAge() functions and are only provided here for sake of completeness.
Using double square brackets, [[]] with a tree will extract node information from the ndlst and generate a Node object.
Whenever a TreeMan object is initiated the consistency of the tree is determined using the fastCheckTreeMan() function. For a more detailed and thorough check use the checkNdlst() function, this will indicate nodes that are incorrect. A TreeMan object must have a root, there must be no circularity and each node must only have one pre-node.
Next page: TreeMen class