Complimenti!

Rimodellare i dati con tidyr

Jeroen Boeye

Head of Machine Learning, Faktion

Separare colonne stringa disordinate

separate()

Colonna con più variabili

Una colonna per variabile

separate_rows()

Cella con più valori

Un valore per cella

Rimodellare i dati con tidyr

Pivotare i dati

pivot_longer()

Variabili come intestazioni

Variabili come intestazioni in formato tidy

pivot_wider()

Nomi di variabili in colonna

Nomi di variabili in colonna corretti

Rimodellare i dati con tidyr

Espandere i dati

complete()

Prima di complete

 

Dopo complete con fill

Rimodellare i dati con tidyr

Espandere liste annidate (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
Rimodellare i dati con tidyr

Fine

Rimodellare i dati con tidyr

Preparing Video For Download...