Do you have any idea why this code is not returning a linear regression line on the plot?
ggplot(data = df3, mapping = aes(x = work_growth, y = gdp_growth, col = RegionCode))
geom_point()
labs (x= "Growth rate of the working-age population",y = "Growth rate of GDP per capita")
geom_smooth(method="lm")
theme_classic() theme(legend.position = "none")
This is plot I get:
Here is the dataframe I'm working with for reference: call using the `regionCode as a color argument
ggplot(data = dat, mapping = aes(x = work_growth, y = gdp_growth))
labs (x= "Growth rate of the working-age population",y = "Growth rate of GDP per capita")
geom_smooth(method="lm")
geom_point(aes(col=RegionCode))
theme_classic() theme(legend.position = "none")