セレクトヘルパー
動画ではセレクトヘルパーの starts_with() を学びました。もう一つのセレクトヘルパーとして ends_with() があり、特定の文字列で終わる列を見つけます。
この演習はコースの一部です
dplyr で行うデータ操作
演習の手順
- 列
state、county、populationと、workで終わるすべての列を選択します。 - 人口の少なくとも 50% が公共事業に従事している郡だけに絞り込みます。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
counties %>%
# Select the state, county, population, and those ending with "work"
___
# Filter for counties that have at least 50% of people engaged in public work
___