1. Learn
  2. /
  3. Courses
  4. /
  5. Building Web Applications with Shiny in R

Exercise

Mass shootings: add inputs

Mass Shootings have been a topic of intense discussion in the United States. A public database of mass shootings since 1982 has been made available by the Mother Jones, a non-profit organization. Over the next three exercises, you will build a Shiny app to explore these shootings on an interactive map.

In this exercise, you will add a slider input to filter on fatalities and a date range input to filter on a range of dates. Your app should resemble the image in this screenshot.

An app with an interactive map of the US and controls to select a date range and number of fatalities

We have already loaded the dataset mass_shootings, and the packages shiny, dplyr, and leaflet.

Instructions

100 XP
  • Add a slider input named nb_fatalities to filter the dataset mass_shootings on the number of fatalities.
  • Add a date range input named date_range to filter on a range of dates.