Aan de slagGa gratis aan de slag

Visualizing sentiment

Let's create a word_counts dataset and explore which words are associated with each sentiment in our Twitter data.

Deze oefening maakt deel uit van de cursus

Introduction to Text Analysis in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

word_counts <- tidy_twitter %>% 
  # Append the NRC dictionary and filter for positive, fear, and trust
  ___(___) %>% 
  ___(___) %>%
  # Count by word and sentiment and keep the top 10 of each
  ___(___) %>% 
  group_by(___) %>% 
  ___(___) %>% 
  ungroup() %>% 
  # Create a factor called word2 that has each word ordered by the count
  mutate(___)
Code bewerken en uitvoeren