按州和大区汇总
您可以按多列进行分组,而不只是按一列。在这里,您将练习按州和大区进行聚合,并体会在连续执行多次聚合时这种方法有多实用。
counties_selected <- counties %>%
select(region, state, county, population)
本练习是课程的一部分
使用 dplyr 进行数据处理
交互式实操练习
通过完成这段示例代码来试试这个练习。
counties_selected %>%
# Group and summarize to find the total population
___