Updates for the Star Schema for Mortality Reporting System by Age Test
Source:R/data.R
updates_st_mrs_age_test.Rd
Example of updates on some dimensions of the star schema for Mortality Reporting System by age test.
Examples
# Defined by:
(dim_names <- st_mrs_age_test |>
get_dimension_names())
#> [1] "when" "when_available" "where" "who"
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")
)