依州彙總
另一個有趣的欄位是 land_area,表示以平方英里計算的陸地面積。這裡你要按州彙總人口與陸地面積,目的在找出人口密度(每平方英里的人數)。
counties_selected <- counties %>%
select(state, county, population, land_area)
本練習屬於課程
使用 dplyr 進行資料操作
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
counties_selected %>%
# Group by state
___
# Find the total area and population
___