row_paths_summary: Print Row/Col Paths Summary

View source: R/summary.R

row_paths_summaryR Documentation

Print Row/Col Paths Summary

Description

Print Row/Col Paths Summary

Usage

row_paths_summary(x)

col_paths_summary(x)

Arguments

x

an rtable object

Value

A data.frame summarizing the row- or column-structure of x.

Examples


library(dplyr)

ex_adsl_MF <- ex_adsl %>% filter(SEX %in% c("M", "F"))

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

tbl <- build_table(lyt, ex_adsl_MF)
tbl

df <- row_paths_summary(tbl)
df

col_paths_summary(tbl)

# manually constructed table
tbl2 <- rtable(
   rheader(
     rrow("row 1", rcell("a", colspan = 2),
     rcell("b", colspan = 2)
   ),
   rrow("h2", "a", "b", "c", "d")),
   rrow("r1", 1, 2, 1, 2), rrow("r2", 3, 4, 2,1)
)
col_paths_summary(tbl2)

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