Session Ready
Exercise

Word cloud Shiny app

You are provided with a sample dataset named artofwar, which contains the entire text of the Art of War book. You can inspect the given Art of War text by running head(artofwar) or tail(artofwar) to see the first and last few verses of the book.

As mentioned in the video, since word clouds are not an output you saw before, they require a new pair of output and render functions: wordcloud2Output() and renderWordcloud2(). These output functions are available from the wordcloud2 package.

Instructions
100 XP

The function create_wordcloud(), the dataset artofwar, and all the necessary packages are available in your workspace.

  • Add a placeholder for a word cloud output to the UI, with an outputId of cloud.
  • Render the word cloud object and assign it to the correct item in the output list (line 11).

By the way, create_wordcloud() is a function we defined for you. You will not be able to run it in your own RStudio on your computer. If you want to have a look at it, type create_wordcloud in the console.