Aan de slagGa gratis aan de slag

Counting user types

Counts are the essential summary for categorical data. Since text is categorical, it's important to get comfortable computing counts. The twitter_data is composed of complaints and non-complaints, as indicated by the complaint_label column, and also includes a column indicating whether or not the user is verified (i.e., they have been confirmed by Twitter to be who they say they are) called usr_verified. Note that column is of type <lgl>, meaning logical. Do verified users complain more?

Deze oefening maakt deel uit van de cursus

Introduction to Text Analysis in R

Cursus bekijken

Oefeninstructies

  • Load the tidyverse package, which includes dplyr and ggplot2.
  • Filter the data to only keep tweets that are complaints.
  • Count the number of verified and non-verified users that have complained.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Load the tidyverse package
___(___)

twitter_data %>% 
  # Filter for just the complaints
  ___(___) %>% 
  # Count the number of verified and non-verified users
  ___(___)
Code bewerken en uitvoeren