Learn R Programming

rtables (version 0.4.0)

add_existing_table: Add an already calculated table to the layout

Description

Add an already calculated table to the layout

Usage

add_existing_table(lyt, tt, indent_mod = 0)

Arguments

lyt

layout object pre-data used for tabulation

tt

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

indent_mod

numeric. Modifier for the default indent position for the structure created by this function(subtable, content table, or row) and all of that structure's children. Defaults to 0, which corresponds to the unmodified default behavior.

Value

A PreDataTableLayouts object suitable for passing to further layouting functions, and to build_table.

Examples

Run this code
# NOT RUN {
tbl1 <- basic_table() %>%
   split_cols_by("ARM") %>%
   analyze("AGE", afun = mean, format = "xx.xx") %>%
   build_table(DM)

tbl1

tbl2 <- basic_table() %>% split_cols_by("ARM") %>%
   analyze("AGE", afun = sd, format = "xx.xx") %>%
   add_existing_table(tbl1) %>%
   build_table(DM)

tbl2

table_structure(tbl2)

row_paths_summary(tbl2)
# }

Run the code above in your browser using DataLab