Skip to contents

render_tree() takes a nested tree structure (as produced by build_tree()) and returns a character vector of lines using box-drawing characters in the style of lobstr::ast().

Usage

render_tree(tree, prefix = "", is_last = TRUE, is_root = TRUE)

Arguments

tree

A nested list with name and children elements.

prefix

Character scalar; the current indentation prefix (used internally during recursion).

is_last

Logical; whether this node is the last sibling.

is_root

Logical; whether this node is the root.

Value

Character vector of formatted lines.