Session Ready
Exercise

Change the word cloud parameters

Recall that create_wordcloud() has two optional arguments: num_words, which is an integer specifying the maximum number of words to draw, and background, which specifies the background color of the image.

Right now, the Shiny app simply outputs a word cloud with the exact same parameters all the time. Since the word cloud generating function accepts these two parameters, it would be wasteful not to use them. The parameters should be adjustable by the user using Shiny inputs.

Your task is to add two inputs to the Shiny app, and use the values from these inputs as the num_words and background parameters of the word cloud.

Instructions
100 XP

All the required packages, including colourpicker, have been loaded to your workspace. Specifically:

  • Add a numeric input with an ID of "num", a default value of 100, and minimum value of 5.
  • Add a color input (from the colourpicker package) with an ID of "col", a label of "Background color", and a default color of "white".
  • Use the values from the two inputs to set the parameters of create_wordcloud() (line 16).