This function visits each node in a tree-like object in an order
determined by the
relationOf function. The function given by
tfun is called for each set of nodes and the function
nfun determines which nodes to test next optionally making use
of the result of the previous test.
1 2 3
A tree-like object that supports the method given by
The set of nodes to start the computation (can be a list of siblings), but the nodes should all belong to the same level of the tree (same path length to root node).
The test function applied to each list of siblings at each
level starting with
A function with signature
The method used to traverse the tree. For example
tree_visitor function is intended to allow developers to
quickly prototype different statistical testing paradigms on trees.
It may be possible to extend this to work for DAGs.
The visit begins by calling
tfun with the nodes provided by
start. The result of each call to
tfun is stored in an
environment. The concept is visitation by tree level and so each
result is stored using a key representing the level (this isn't quite
right since the nodes in
start need not be first level, but
they will be assigned key "1". After storing the result,
is used to obtain a vector of accepted node labels. The idea is that
the user should have a way of determining which nodes in the next
level of the tree are worth testing. The next
start set is
start <- relationOf(g, accepted) where accepted
A list. See the return value of
cb_test to get an idea. Each
element of the list represents a call to
tfun at a given level
of the tree.