IniziaInizia gratis

Visualizing word counts with facets

The word_counts from the previous exercise have been loaded. Let's visualize the word counts for the Twitter data with separate facets for complaints and non-complaints.

Questo esercizio fa parte del corso

Introduction to Text Analysis in R

Visualizza il corso

Istruzioni dell'esercizio

  • Include a color aesthetic tied to whether or not its a complaint.
  • Don't include the legend for the column plot.
  • Facet by whether or not the tweet comes from a complaint and make the y-axis free.
  • Flip the coordinates and add a title: "Twitter Word Counts".

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Include a color aesthetic tied to whether or not its a complaint
ggplot(word_counts, aes(x = word2, y = n, ___)) +
  # Don't include the lengend for the column plot
  geom_col(___) +
  # Facet by whether or not its a complaint and make the y-axis free
  ___(___, scales = ___) +
  # Flip the coordinates and add a title: "Twitter Word Counts"
  ___() +
  ___(___)
Modifica ed esegui il codice