CommencerCommencer gratuitement

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?

Cet exercice fait partie du cours

Introduction to Text Analysis in R

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Load the tidyverse package
___(___)

twitter_data %>% 
  # Filter for just the complaints
  ___(___) %>% 
  # Count the number of verified and non-verified users
  ___(___)
Modifier et exécuter le code