Tidyr을 활용한 데이터 정리
목적 DSR 패키지에 포함된 데이터셋으로 정돈된 데이터 연습 다른 패키지와 tidyr의 함수 대응 관계는 아래와 같다 reshape2의 melt와 dcast는 tidyr의 gather와 spread로 대체 가능하다 tidyr gather spread reshape2 melt cast spreadsheets unpivot pivot databases fold unfold 사용한 패키지 library(tidyverse) library(DSR) TB를 포함한 table1~6에서 Spread와 Gather사용 > table1 # A tibble: 6 x 4 country year cases population 1 Afghanistan 1999 745 19987071 2 Afghanistan 2000 2666 2..
2019. 4. 18. 03:03