source | dataset | .html | .RData |
---|---|---|---|
oecd | api | 2024-04-16 | 2024-04-16 |
source | dataset | .html | .RData |
---|---|---|---|
bdf | api | 2024-04-18 | NA |
bea | api | 2024-02-11 | NA |
bis | api | 2024-04-19 | NA |
bls | api | 2024-02-11 | NA |
ecb | api | 2024-04-19 | NA |
eurostat | api | 2024-04-18 | NA |
imf | api | 2024-02-11 | NA |
insee | api | 2024-04-30 | NA |
oecd | api | 2024-04-16 | 2024-04-16 |
rdb | api | 2024-04-25 | NA |
wdi | api | 2024-04-14 | NA |
LAST_COMPILE |
---|
2024-05-07 |
OECD Data API documentation: https://gitlab.algobank.oecd.org/public-documentation/dotstat-migration/-/raw/main/OECD_Data_API_documentation.pdf
Upgrading your queries from the legacy OECD.Stat APIs to the new OECD Data API. pdf
metadata_load <- function(code, CL_code, data = QNA_EXPENDITURE_CAPITA_var){
assign(code, as.data.frame(data@codelists, codelistId = CL_code) %>%
select(id, label.en) %>%
setNames(c(code, str_to_title(code))),
envir = .GlobalEnv)
}
metadata_load("REF_AREA", "CL_AREA")
REF_AREA %>%
print_table_conditional()
metadata_load_fr <- function(code, CL_code, data = QNA_EXPENDITURE_CAPITA_var){
assign(code, as.data.frame(data@codelists, codelistId = CL_code) %>%
select(id, label.fr) %>%
setNames(c(code, str_to_title(code))),
envir = .GlobalEnv)
}
metadata_load_fr("REF_AREA", "CL_AREA")
REF_AREA %>%
print_table_conditional()
QNA_EXPENDITURE_CAPITA %>%
filter(REF_AREA %in% c("USA", "EA20"),
FREQ == "Q",
PRICE_BASE == "LR") %>%
quarter_to_date %>%
filter(date >= as.Date("1999-01-01")) %>%
left_join(REF_AREA, by = "REF_AREA") %>%
group_by(Ref_area) %>%
arrange(date) %>%
mutate(obsValue = 100 * obsValue / obsValue[1]) %>%
ggplot(.) + theme_minimal() + xlab("") + ylab("PIB par habitant (1999T1 = 100)") +
geom_line(aes(x = date, y = obsValue, color = Ref_area)) +
scale_color_manual(values = c("#B22234", "#003399")) +
geom_rect(data = nber_recessions %>%
filter(Peak > as.Date("1999-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = 0, ymax = +Inf),
fill = '#B22234', alpha = 0.1) +
geom_rect(data = cepr_recessions %>%
filter(Peak > as.Date("1999-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = 0, ymax = +Inf),
fill = '#003399', alpha = 0.1) +
scale_x_date(breaks = c(seq(1999, 2100, 5), seq(1997, 2100, 5)) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%Y")) +
theme(legend.position = c(0.26, 0.8),
legend.title = element_blank()) +
scale_y_log10(breaks = seq(50, 200, 5))