expand_formats: Expand A List Of Formats To Generate All Possible...

View source: R/create_format.R

expand_formatsR Documentation

Expand A List Of Formats To Generate All Possible Combinations

Description

Generates a data frame which contains all nested combinations of the provided format labels.

Usage

expand_formats(..., names = NULL)

Arguments

...

A list containing format data frames.

names

Custom variable names for the newly generated data frame.

Value

Returns a data frames with all format label combinations.

Examples

# Example formats
sex. <- discrete_format(
    "Total"  = 1:2,
    "Male"   = 1,
    "Female" = 2)

age. <- discrete_format(
    "Total"          = 0:100,
    "under 18"       = 0:17,
    "18 to under 25" = 18:24,
    "25 to under 55" = 25:54,
    "55 to under 65" = 55:64,
    "65 and older"   = 65:100)

# Expand formats
expand_df <- expand_formats(sex., age.,
                            names = c("sex", "age"))


qol documentation built on March 11, 2026, 1:06 a.m.