vars_in_layout | R Documentation |
List variables required by a pre-data table layout
vars_in_layout(lyt)
## S4 method for signature 'PreDataTableLayouts'
vars_in_layout(lyt)
## S4 method for signature 'PreDataAxisLayout'
vars_in_layout(lyt)
## S4 method for signature 'SplitVector'
vars_in_layout(lyt)
## S4 method for signature 'Split'
vars_in_layout(lyt)
## S4 method for signature 'CompoundSplit'
vars_in_layout(lyt)
## S4 method for signature 'ManualSplit'
vars_in_layout(lyt)
lyt |
( |
This will walk the layout declaration and return a vector of the names of the unique variables that are used in any of the following ways:
Variable being split on (directly or via cuts)
Element of a Multi-variable column split
Content variable
Value-label variable
A character vector containing the unique variables explicitly used in the layout (see the notes below).
This function will not detect dependencies implicit in analysis or summary functions which accept x
or df
and then rely on the existence of particular variables not being split on/analyzed.
The order these variable names appear within the return vector is undefined and should not be relied upon.
lyt <- basic_table() %>%
split_cols_by("ARM") %>%
split_cols_by("SEX") %>%
summarize_row_groups(label_fstr = "Overall (N)") %>%
split_rows_by("RACE",
split_label = "Ethnicity", labels_var = "ethn_lab",
split_fun = drop_split_levels
) %>%
summarize_row_groups("RACE", label_fstr = "%s (n)") %>%
analyze("AGE", var_labels = "Age", afun = mean, format = "xx.xx")
vars_in_layout(lyt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.