Hi! I am having some issues making a plot. My goal is to have a plot that shows the inflation of turkey compared to OECD total. I am able to get a plot however the lines are not at all how they should be.
rep:
library(tidyverse)
library(janitor)
library(OECD)
dsets<-get_datasets()
search_dataset("cpi",dsets)
CPI <- get_dataset("PRICES_CPI",
filter = "TUR+OECD",
start_time = 2003,
end_time = 2023,
pre_formatted = TRUE)
CPI <- CPI %>%
filter(TIME_FORMAT=="P1M",
REFERENCEPERIOD == "2015_100",
MEASURE == "IXOB")
CPI <- CPI %>%
select(Time, ObsValue, LOCATION)
CPI <- CPI %>%
mutate(date = ym(Time))
p <- ggplot(CPI, aes(x=date, y = ObsValue, group = LOCATION, color = LOCATION))+
geom_line(aes(group=LOCATION), size = 1) +
labs(title = "Inflation in Turkey compared to OECD Total the past 20 years (2015=100)")
p
My output looks like this:
However I want it to look something like this:
I appreciate any help!