# 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"))
Run the code above in your browser using DataLab