Learn R Programming

rtables (version 0.4.0)

vars_in_layout: List Variables required by a pre-data table layout

Description

List Variables required by a pre-data table layout

Usage

vars_in_layout(lyt)

# S4 method for PreDataTableLayouts vars_in_layout(lyt)

# S4 method for PreDataAxisLayout vars_in_layout(lyt)

# S4 method for SplitVector vars_in_layout(lyt)

# S4 method for Split vars_in_layout(lyt)

# S4 method for CompoundSplit vars_in_layout(lyt)

# S4 method for ManualSplit vars_in_layout(lyt)

Arguments

lyt

The Layout (or a component thereof)

Value

A character vector containing the unique variables explicitly used in the layout (see Notes).

Details

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

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab