construct_tree: Create an ordered tree from a data frame.

View source: R/filters.R

construct_treeR Documentation

Create an ordered tree from a data frame.

Description

Will create a tree as a nested list from a data frame with specified order.

Usage

construct_tree(
  data,
  id_column = 1,
  parent_id_column = 2,
  sort_order_column = 3
)

Arguments

data

Data frame with at minimum id, parent id and sort order columns to construct tree from.

id_column

Index of column containing IDs.

parent_id_column

Index of column containing parent IDs.

sort_order_column

Index of column containing sort orders.

Value

The tree represented as a list.


mrc-ide/hintr documentation built on April 25, 2024, 11:58 p.m.