View source: R/create_format.R
| expand_formats | R Documentation |
Generates a data frame which contains all nested combinations of the provided format labels.
expand_formats(..., names = NULL)
... |
A list containing format data frames. |
names |
Custom variable names for the newly generated data frame. |
Returns a data frames with all format label combinations.
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.