library(knitr)

opts_chunk$set(echo=TRUE,
               warning=FALSE,
               message=FALSE,
               cache=FALSE)

devtools::load_all(here::here())

Import data

Data source

Data on divorces and marriages can be found on the Statbel site.

For most data we have the same information for marriages and divorces:

For marriages we have data from 2013-2016, for divorces 2012-2016. We'll limit ourselves to 2013-2016

Let's focus on age since a lot of interesting questions immediately come to mind:

Download data

types <- c("divorce","marriage")
years <- paste0("201", 3:6)

rep_years <- rep(years, times = length(types))
rep_types <- rep(types, each = length(years))

purrr::walk2(.x = rep_years,
             .y = rep_types,
             ~download(year = .x, type = .y))


IsaacVerm/marriage documentation built on May 17, 2019, 6:19 p.m.