1. 学ぶ
  2. /
  3. コース
  4. /
  5. Data Manipulation with dplyr

Connected

演習

Summarizing by state

Another interesting column is land_area, which shows the land area in square miles. Here, you'll summarize both population and land area by state, with the purpose of finding the density (in people per square miles).

counties_selected <- counties %>%
  select(state, county, population, land_area)

指示1 / 2

undefined XP
    1
    2
  • Group the data by state, and summarize to create the columns total_area (the total land_area in square miles) and total_population (with total population).