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.
tree_visitor(g, start, tfun, nfun, relationOf)
topdown_tree_visitor(g, start, tfun, nfun)
bottomup_tree_visitor(g, start, tfun, nfun)relationOf.start. The signature of tfun
should be (start, g, prev_ans).(ans, g) that processes
the result of tfun and returns a character vector of node
names corresponding to nodes that were involved in an "interesting"
test. This is used to determine the next set of nodes to test (see
details).childrenOf or parentOf.cb_test to get an idea. Each
element of the list represents a call to tfun at a given level
of the tree.
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, nfun
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
determined by start <- relationOf(g, accepted) where accepted
is unique(nfun(ans, g)).