群組變數
我們延續上一題,來看看如何在資料集中檢視子群。為此你會遇到看不見的 group 美感(aesthetic)。
這裡的 mtcars 多了一個欄位 fcyl,它是把 cyl 欄位轉換成適當的因素變數(factor)。
本練習屬於課程
ggplot2 中級資料視覺化
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Using mtcars, plot mpg vs. wt, colored by fcyl
___ +
# Add a point layer
___ +
# Add a smooth lin reg stat, no ribbon
___