node_depth.Rd
Computes the depth of each node in a given tree data frame, assuming a binary tree structure. Requires the tree data frame to contain a logical column `terminal` indicating terminal nodes.
node_depth(tree)
tree | A data frame representing a tree, must contain a `terminal` column. |
---|
A vector of depths corresponding to each node in the tree.