주(state)별 요약하기
또 하나 흥미로운 열은 land_area로, 면적을 제곱마일 단위로 보여줍니다. 여기서는 인구와 면적을 주(state) 단위로 요약해, 인구 밀도(제곱마일당 인원)를 계산해 볼 거예요.
counties_selected <- counties %>%
select(state, county, population, land_area)
이 연습은 강의의 일부입니다
dplyr로 데이터 조작하기
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
counties_selected %>%
# Group by state
___
# Find the total area and population
___