用 geom_smooth() 替xy散佈圖加上趨勢線,使用linear regresion. ggplot(df, aes(x = z, y = y)) +geom_point()+facet_grid(gp~.)+geom_smooth(method='lm').
確定! 回上一頁