시작하기무료로 시작하기

정돈된 Big 테이블

마지막으로, "bigmemory" 패키지 모음과 "tidyverse" 패키지를 함께 사용하는 연습으로, 이번에도 tidyrggplot2를 활용해 시간에 따른 Borrower Income 비율을 시각화해 보겠습니다.

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

R에서 확장 가능한 데이터 처리

강의 보기

연습 안내

  • tidyrggplot2 패키지를 로드하세요.
  • pivot_longer() 함수를 사용해 연도별 집계를 모아 주세요.
  • x축에 Year, y축에 Count를 두고 선 그래프를 만드세요. BIR로 색상과 그룹을 지정하세요.

실습형 인터랙티브 연습

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

# Load the tidyr and ggplot2 packages
library(___)
library(___)

bir_df_wide %>% 
    # Transform the wide-formatted data.frame into the long format
    ___(-BIR, names_to = "Year", values_to = "Count") %>%
    # Use ggplot to create a line plot
    ggplot(aes(x = ___, y = ___, group = BIR, color = BIR)) + 
    ___
코드 편집 및 실행