| bind_table | R Documentation |
tidytlg tables together with formatting variablesbind_table combines analysis results with formatting variables
(indentme, newrows, newpage) based on by variables
(tablebyvar, rowbyvar), such that appropriate formatting (indentation,
line break, page break) can be applied while creating the output.
It can also attach the column metadata attribute,
which will be automatically used in gentlg for creating output.
bind_table(
...,
colvar = NULL,
tablebyvar = NULL,
rowbyvar = NULL,
prefix = NULL,
add_count = FALSE,
add_format = TRUE,
column_metadata_file = NULL,
column_metadata = NULL,
tbltype = NULL
)
... |
(required) a set of |
colvar |
(required) treatment variable within |
tablebyvar |
(optional) repeat entire table by variable within |
rowbyvar |
(optional) any |
prefix |
(optional) text to prefix the values of |
add_count |
(optional) Should a count be included in the |
add_format |
(optional) Should format be added to the output table?
This is done using the |
column_metadata_file |
(optional) An excel file for |
column_metadata |
(optional) A dataframe containing the column metadata.
This will be used in place of |
tbltype |
(optional) A value used to subset the |
The tidytlg tables bound together reflecting the
tablebyvars used.
library(magrittr)
# bind tables together
t1 <- cdisc_adsl %>%
freq(
colvar = "TRT01PN",
rowvar = "ITTFL",
statlist = statlist("n"),
subset = ITTFL == "Y",
rowtext = "Analysis set: ITT"
)
t2 <- cdisc_adsl %>%
univar(
colvar = "TRT01PN",
rowvar = "AGE",
decimal = 0,
row_header = "Age, years"
)
bind_table(t1, t2)
# bind tables together w/by groups
t1 <- cdisc_adsl %>%
freq(
colvar = "TRT01PN",
rowvar = "ITTFL",
rowbyvar = "SEX",
statlist = statlist("n"),
subset = ITTFL == "Y",
rowtext = "Analysis set: ITT"
)
t2 <- cdisc_adsl %>%
univar(
colvar = "TRT01PN",
rowvar = "AGE",
rowbyvar = "SEX",
decimal = 0,
row_header = "Age, years"
)
bind_table(t1, t2, rowbyvar = "SEX")
# bind tables together w/table by groups
t1 <- cdisc_adsl %>%
freq(
colvar = "TRT01PN",
rowvar = "ITTFL",
tablebyvar = "SEX",
statlist = statlist("n"),
subset = ITTFL == "Y",
rowtext = "Analysis set: ITT"
)
t2 <- cdisc_adsl %>%
univar(
colvar = "TRT01PN",
rowvar = "AGE",
tablebyvar = "SEX",
decimal = 0,
row_header = "Age, years"
)
bind_table(t1, t2, tablebyvar = "SEX")
# w/prefix
bind_table(t1, t2, tablebyvar = "SEX", prefix = "Gender: ")
# w/counts
bind_table(t1, t2, tablebyvar = "SEX", add_count = TRUE, colvar = "TRT01PN")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.