data-raw/gl_reg_births.R

library(dplyr)

pxweb_births <- readRDS("data-raw/pxweb_births.rds")

gl_reg_births <- pxweb_births %>%
    select(cohort = "mother's year of birth",
           age = "mother's age",
           gender,
           time,
           count = "Live births by Greenland's administrative division") %>%
    mutate(cohort = as.integer(cohort),
           age = as.integer(age),
           time = as.integer(time),
           count = as.integer(count)) %>%
    count(cohort, age, gender, time, wt = count, name = "count")


save(gl_reg_births,
     file = "data/gl_reg_births.rda",
     compress = "xz")
ONSdigital/Bayesian-demographic-accounts documentation built on Jan. 10, 2022, 12:34 a.m.