tree_depth: Find Tree Depth Based on Node Indexes

Description Usage Arguments Details Value

View source: R/utils.R

Description

Find Tree Depth Based on Node Indexes

Usage

1
tree_depth(nodes)

Arguments

nodes

Vector of node indexes in the tree.

Details

When building MonoClust tree, the node index was created with the rule that new node indexes are the split node times 2 plus 0 (left) and 1 (right). Therefore, this function is just a back-transform, taking a log base 2.

Value

Depth of the node, with 0 is the root relative to the input.


monoClust documentation built on Feb. 15, 2021, 5:07 p.m.