Visualizing complaints
We ended the last chapter with complaint word counts. Now let's visualize those word counts with a bar plot.
The tidyverse and tidytext packages have been loaded. twitter_data has been tokenized and the standard stop words have been removed.
Este ejercicio forma parte del curso
Introduction to Text Analysis in R
Instrucciones del ejercicio
- Only keep the words with counts greater than 100.
- Create a bar plot using
word_countswithwordmapped to the x-axis. - Flip the plot coordinates.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
word_counts <- tidy_twitter %>%
filter(complaint_label == "Complaint") %>%
count(word) %>%
# Keep words with count greater than 100
___(___)
# Create a bar plot using word_counts with x = word
ggplot(___, aes(___, ___)) +
geom_col() +
# Flip the plot coordinates
___()