updates_st_mrs_age_test | R Documentation |
Example of updates on some dimensions of the star schema for Mortality Reporting System by age test.
updates_st_mrs_age_test
A record_update_set
object.
# Defined by:
(dim_names <- st_mrs_age_test |>
get_dimension_names())
where <- st_mrs_age_test |>
get_dimension("where")
when <- st_mrs_age_test |>
get_dimension("when")
who <- st_mrs_age_test |>
get_dimension("who")
updates_st_mrs_age_test <- record_update_set() |>
update_selection_general(
dimension = where,
columns_old = c("state", "city"),
old_values = c("CT", "Bridgepor"),
columns_new = c("city"),
new_values = c("Bridgeport")
) |>
match_records(dimension = when,
old = 4,
new = 3) |>
update_record(
dimension = when,
old = 9,
values = c("1962-01-20", "03", "1962")
) |>
update_selection(
dimension = who,
columns = c("age_range"),
old_values = c("<1 year"),
new_values = c("1: <1 year")
) |>
update_selection(
dimension = who,
columns = c("age_range"),
old_values = c("1-24 years"),
new_values = c("2: 1-24 years")
) |>
update_selection(
dimension = who,
columns = c("age_range"),
old_values = c("25-44 years"),
new_values = c("3: 25-44 years")
) |>
update_selection(
dimension = who,
columns = c("age_range"),
old_values = c("45-64 years"),
new_values = c("4: 45-64 years")
) |>
update_selection(
dimension = who,
columns = c("age_range"),
old_values = c("65+ years"),
new_values = c("5: 65+ years")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.