path_enriched_df: Transform 'TableTree' object to Path-Enriched data.frame

View source: R/tt_export.R

path_enriched_dfR Documentation

Transform TableTree object to Path-Enriched data.frame

Description

Transform TableTree object to Path-Enriched data.frame

Usage

path_enriched_df(tt, path_fun = collapse_path, value_fun = collapse_values)

Arguments

tt

TableTree (or related class). A TableTree object representing a populated table.

path_fun

function. Function to transform paths into single-string row/column names.

value_fun

function. Function to transform cell values into cells of the data.frame. Defaults to collapse_values which creates strings where multi-valued cells are collapsed together, separated by |.

Value

A data frame of tt's cell values (processed by value_fun, with columns named by the full column paths (processed by path_fun and an additional row_path column with the row paths (processed by by path_fun).

Examples


lyt <- basic_table() %>%
  split_cols_by("ARM") %>%
  analyze(c("AGE", "BMRKR2"))

tbl <- build_table(lyt, ex_adsl)
path_enriched_df(tbl)

rtables documentation built on Aug. 30, 2023, 5:07 p.m.