Rename the attributes of the dimension table. It is especially useful if we want to export the table, for example, to a database.
Usage
set_table_attribute_names(td, names)
# S3 method for when
set_table_attribute_names(td, names = NULL)
See also
Other obtaining results:
generate_table()
,
get_level_attribute_names()
,
get_level_names()
,
get_table_attribute_names()
Examples
wd <- when() |>
generate_table()
wd |>
get_table_attribute_names()
#> [1] "c('id', 'date', 'month_day', 'week_day', 'day_name', 'day_num_name', 'year_week', 'week', 'year_month', 'month', 'month_name', 'month_num_name', 'year')"
wd <- wd |>
set_table_attribute_names(
c(
'id_when',
'date',
'month_day',
'week_day',
'day_name',
'day_num_name',
'year_week',
'week',
'year_month',
'month',
'month_name',
'month_num_name',
'year'
)
)