print_tree: Print a Tree-Like Structure of a List

View source: R/print_tree.R

print_treeR Documentation

Description

Recursively prints a tree-like structure of a list object with proper indentation to visualize its hierarchy. This function aims to mimic the output of 'lobstr::tree' with full values shown and colorized output for the list elements.

Usage

print_tree(x, indent = "", last = TRUE)

Arguments

x

A list object to be printed as a tree structure.

indent

A string used internally by the function to manage indentation. It is not intended to be set by the user.

last

A logical value used internally to indicate if the current element is the last in its sublist. It is not intended to be set by the user.

Examples

config <- list(
  run_behav = TRUE,
  paths = list(
    raw = list(
      behav = "/path/to/behav",
      eye = "/path/to/eye"
    )
  )
)
print_tree(config)


natehall329/nate_utils documentation built on Dec. 31, 2024, 3:25 p.m.