Aan de slagGa gratis aan de slag

Practicing reshaping data

The pivot_wider() verb allows us to quickly reshape or stack and transpose our data, making it easier to mutate().

Deze oefening maakt deel uit van de cursus

Introduction to Text Analysis in R

Cursus bekijken

Oefeninstructies

  • Append tidy_twitter to the NRC sentiment dictionary.
  • Count by complaint label and sentiment.
  • Widen the sentiment and count columns.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

tidy_twitter %>% 
  # Append the NRC sentiment dictionary
  ___(___) %>% 
  # Count by complaint label and sentiment
  ___(___) %>% 
  # Spread the sentiment and count columns
  ___(___, )
Code bewerken en uitvoeren