~/data/oecd/
Data Structure
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
|
SEX
SEX
|
SEX Description
|
Nobs
|
MW
|
All persons
|
2809
|
WOMEN
|
Women
|
2809
|
MEN
|
Men
|
2808
|
All persons, All ages
France
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, 2025, 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))