地域ごとのカウント
countiesデータセットには、region、state、population、citizensの列があり、これらを選択してcounties_selectedというテーブルに保存しました。この演習では、region列に注目します。
counties_selected <- counties %>%
select(county, region, state, population, citizens)
この演習はコースの一部です
dplyr で行うデータ操作
演習の手順
count()を使って、各地域に含まれる郡の数を求め、結果が降順になるよう第2引数で並べ替えてください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Use count to find the number of counties in each region
counties_selected %>%
___