축하합니다!

tidyr로 데이터 재구조화하기

Jeroen Boeye

Head of Machine Learning, Faktion

지저분한 문자열 열 분리

separate()

여러 변수가 담긴 열

변수별 개별 열

separate_rows()

여러 값이 있는 셀

셀당 한 값

tidyr로 데이터 재구조화하기

데이터 피벗팅

pivot_longer()

헤더에 있는 변수

정돈된 헤더 변수

pivot_wider()

열에 있는 변수명

수정된 변수명 열

tidyr로 데이터 재구조화하기

데이터 확장

complete()

complete 전

 

채움 포함 complete 후

tidyr로 데이터 재구조화하기

데이터 펼치기(unnest)

tibble(character = star_wars_list) %>% 
  unnest_wider(character) %>% 
  unnest_longer(films)
# A tibble: 45 x 2
   name        films                  
   <chr>       <chr>                  
 1 Chewbacca   Revenge of the Sith    
 2 Chewbacca   Return of the Jedi     
 3 Chewbacca   The Empire Strikes Back
 4 Chewbacca   A New Hope             
 5 Chewbacca   The Force Awakens      
 6 Darth Vader Revenge of the Sith    
 7 Darth Vader Return of the Jedi     
 8 Darth Vader The Empire Strikes Back
# ... with 37 more rows
tidyr로 데이터 재구조화하기

마무리

tidyr로 데이터 재구조화하기

Preparing Video For Download...