Skip to content

Instantly share code, notes, and snippets.

@bttomio
Created January 15, 2021 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bttomio/3472e7bbf6afdeb4897fbaddf45fce47 to your computer and use it in GitHub Desktop.
Save bttomio/3472e7bbf6afdeb4897fbaddf45fce47 to your computer and use it in GitHub Desktop.
# Leading Indicators OECD: Reference series: Gross Domestic Product (GDP): Normalised [LORSGPNO]
# Level, rate or national currency, seasonally adjusted [STSA]
library(OECD)
dataset <- "MEI" # MAIN ECONOMIC INDICATORS
filter_list <- list("", "LORSGPNO", "STSA", "M") # SEQUENCE SENSITIVE
GDP <- get_dataset(dataset = dataset, filter = filter_list)
library(ggplot2)
GDP_all <- GDP %>%
subset(obsTime >= "2020-01") %>%
ggplot(aes(x = obsTime, y = obsValue, group = LOCATION, colour = LOCATION)) +
geom_line() +
theme_minimal() +
theme(legend.position = "bottom", axis.title.x = element_blank()) +
labs(y = "GDP (2005 = 100)")
library(gghighlight)
GDP_CHN <- GDP %>%
subset(obsTime >= "2020-01") %>%
ggplot(aes(x = obsTime, y = obsValue, group = LOCATION, colour = LOCATION)) +
geom_line() +
theme_minimal() +
theme(legend.position = "bottom", axis.title.x = element_blank()) +
labs(y = "GDP (2005 = 100)") +
gghighlight(LOCATION == "CHN", label_params = c(box.padding = 0.5, max.overlaps = Inf))
GDP_FRA <- GDP %>%
subset(obsTime >= "2020-01") %>%
ggplot(aes(x = obsTime, y = obsValue, group = LOCATION, colour = LOCATION)) +
geom_line() +
theme_minimal() +
theme(legend.position = "bottom", axis.title.x = element_blank()) +
labs(y = "GDP (2005 = 100)") +
gghighlight(LOCATION == "FRA", label_params = c(box.padding = 0.5, max.overlaps = Inf))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment