你知道為什么這段代碼沒有在圖中回傳線性回歸線嗎?
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")
這是我得到的情節:
這是我正在使用的資料框以供參考:
呼叫使用 `regionCode 作為顏色引數來繪制點
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")
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/381254.html
上一篇:如何創建世界地圖,上面有熱圖
