Felicitări!

Restructurarea datelor cu tidyr

Jeroen Boeye

Head of Machine Learning, Faktion

Separarea coloanelor de tip șir

separate()

Coloană cu mai multe variabile

O coloană per variabilă

separate_rows()

Celulă cu mai multe valori

O valoare per celulă

Restructurarea datelor cu tidyr

Pivotarea datelor

pivot_longer()

Variabile ca anteturi

Variabile ca anteturi - ordonat

pivot_wider()

Nume de variabile în coloană

Nume de variabile în coloană - ordonat

Restructurarea datelor cu tidyr

Extinderea datelor

complete()

Înainte de complete

 

După complete cu fill

Restructurarea datelor cu tidyr

Dezanidarea datelor

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
Restructurarea datelor cu tidyr

Sfârșit

Restructurarea datelor cu tidyr

Preparing Video For Download...