시작하기무료로 시작하기

지역별로 세기

counties 데이터셋에는 지역(region), 주(state), 인구(population), 시민 수(citizens) 열이 있으며, 이를 선택해 counties_selected 테이블로 저장했습니다. 이번 연습에서는 region 열에 집중해 볼 거예요.

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

이 연습은 강의의 일부입니다

dplyr로 데이터 조작하기

강의 보기

연습 안내

  • count()를 사용해 각 지역의 카운티 수를 구하고, 두 번째 인수를 이용해 내림차순으로 정렬하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Use count to find the number of counties in each region
counties_selected %>%
  ___
코드 편집 및 실행