Populates `childLeft`, `childRight`, and `parent` columns in the dataset to establish parent-child relationships between nodes based on tree structure.

getChildren(data)

Arguments

data

A data frame with tree structure, including `iteration`, `treeNum`, `node`, and `depth` columns, along with a `terminal` indicator.

Value

The modified data frame with `childLeft`, `childRight`, and `parent` columns added, detailing the tree's parent-child node relationships.

Examples

# Assuming `treeData` has been prepared with terminal node indicators
treeData <- getChildren(data = treeData)
#> Generating Child/Parent Mappings:
#> Error in eval(expr, envir, enclos): object 'treeData' not found