Hye there,
I have a dataset (dataset4) representing the gdp over years for different countries.
I have EU and non EU country.
I need to do a figure representing the maxium gdp over the years for each type of countries by two lines : one for EU countries and the other one for non-EU countries. I am struggling a lot. I don't know how to do so.
I have tried this code but it doesn't work.
library(dplyr)
library(ggplot2)
ggplot(dataset4, aes(x=years, y=gdp, col=CountryName)) +
geom_line() +
geom_line(data=dataset4, aes(y=m), col="blue", lty=2) +
labs(caption = "maximum gdp over years") +
theme_minimal() +
theme(legend.title=element_blank(), legend.position = "bottom",
plot.caption = element_text(hjust = 0, face="italic"))
If someone knew how to solve it, it would be great.
Thanks in advance,
Alex