Create a summary table using multiple rows for grouping on two target column ideal for creating change from baseline tables
Source:R/summary-table.R
summary_table_by_targets.RdCreate a summary table using multiple rows for grouping on two target column ideal for creating change from baseline tables
Usage
summary_table_by_targets(
dt,
target,
treat,
rows_by,
indent = nbsp(n = 4L),
.total_dt = NULL,
pct_dec = 1,
treat_order = NULL,
skip_absent = TRUE,
sep = "."
)Arguments
- dt
table to perform function on
- target
vector of column names desired to obtain information on
- treat
string of treatment variable used for splitting / grouping data
- rows_by
string, grouping variable to split events by.
- indent
indent to be used for display and formatting purposes
- .total_dt
optional table for total counts to be derived
- pct_dec
decimal places for percentages
- treat_order
customise the column order of output table
- skip_absent
Logical, default
TRUE. Passed todata.table::setcolorder, iftreat_orderincludes columns not present indt:TRUEwill silently ignore themFALSEwill throw an error
- sep
character string to separate the terms