Code
load_data("oecd/AVD_DUR_var.RData")
AVD_DUR <- read_parquet("AVD_DUR.parquet")Data - OECD
load_data("oecd/AVD_DUR_var.RData")
AVD_DUR <- read_parquet("AVD_DUR.parquet")Last observation: A: 2021 (N = 195)
First observation: A: 1968 (N = 18)
Last data update: 02 aoû 2026, 08:56. Last compile: 17 aoû 2026, 22:37
AVD_DUR |>
left_join(AVD_DUR_var |> pluck("AGE"), by = c("AGE" = "id")) |>
rename(`AGE Description` = label) |>
group_by(AGE, `AGE Description`, SEX) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}AVD_DUR_var |>
pluck("VAR_DESC") %>%
{if (is_html_output()) print_table(.) else .}| id | description |
|---|---|
| COUNTRY | Country |
| TIME | Time |
| SEX | Sex |
| AGE | Age |
| FREQUENCY | Frequency |
| OBS_VALUE | Observation Value |
| TIME_FORMAT | Time Format |
| OBS_STATUS | Observation Status |
| UNIT | Unit |
| POWERCODE | Unit multiplier |
| REFERENCEPERIOD | Reference period |
AVD_DUR |>
filter(AGE == "900000",
COUNTRY == "FRA") |>
year_to_enddate() |>
left_join(AVD_DUR_var |> pluck("SEX"), by = c("SEX" = "id")) |>
rename(SEX_desc = label) |>
ggplot() + theme_minimal() +
geom_line(aes(x = date, y = obsValue, color = SEX_desc, linetype = SEX_desc)) +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.position = c(0.85, 0.9),
legend.title = element_blank()) +
xlab("") + ylab("Duration") +
scale_x_date(breaks = seq(1920, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
theme(legend.position = c(0.47, 0.9),
legend.title = element_blank(),
legend.direction = "horizontal") +
scale_y_continuous(breaks = seq(0, 20, 1))