find_node_by_name: Find node by name in a tree structure

View source: R/annotate_gui.R

find_node_by_nameR Documentation

Find node by name in a tree structure

Description

Recursively searches through a tree structure to find a node with a specific name. The search is performed depth-first and returns the first matching node found.

Usage

find_node_by_name(node, target_name)

Arguments

node

Node object representing the current position in the tree. Should have:

  • name: Character string identifier

  • children: List of child nodes

target_name

Character string specifying the name to search for

Details

The function handles NULL inputs safely and performs a recursive depth-first search through the tree structure. It checks node names and recursively searches through child nodes.

Value

Node object if found, NULL otherwise


textAnnotatoR documentation built on April 3, 2025, 7:35 p.m.