Session Ready
Exercise

Allow "All" continents to be viewed

Before adding the continent selector, the Shiny app showed data for all continents. Now that the continent selector was added, the data can be viewed per continent. But what if the user decides they actually don't want to filter for a specific continent, and they prefer to see all of them? Unfortunately, adding the continent selector removed that ability.

The choices argument of the selectInput() function can be modified to add another value to the continent list, and when this value is chosen, continent filtering can be turned off.

Instructions
100 XP

Add an option in the select input to select "All" continents. When that option is selected, do not perform any continent filtering. Specifically:

  • Add an "All" value to the list of options that are provided to the select input in the UI.
  • In the server, use an if statement to check if the continent is set to "All". If "All" is chosen, then do not perform any filtering on continents (line 20).