Due by 12pm on Wednesday March 13th.

Fork the hw10 repository

Go here to fork the repo for homework 10.

What we’ve done

We created a Shiny app that lets you search for products from Virginia ABC stores based on price, alcohol type, and proof. We used this dataset and this code for our app.

What you need to do

Option A - extend the Virginia ABC store app

The app is functional, but there is plenty of room for improvements. For the homework, you need to add 3 or more features to the Virginia ABC store app. Potential features could be (but are not limited to):

  • Add an option to sort the results table by price.
    • Hint: Use checkboxInput() to get TRUE/FALSE values from the user.
  • Use the DT package to turn the current results table into an interactive table.
    • Hint: Install the DT package, replace tableOutput() with DT::dataTableOutput() and replace renderTable() with DT::renderDataTable().
  • Add parameters to the plot.
    • Hint: You will need to add input functions that will be used as parameters for the plot. You could use shinyjs::colorInput() to let the user decide on the colors of the bars in the plot.
  • Place the plot and the table in separate tabs.
    • Hint: Use tabsetPanel() to create an interface with multiple tabs.
  • If you know CSS, add CSS to make your app look nicer.
    • Hint: Add a CSS file under www and use the function includeCSS() to use it in your app.
  • Experiment with packages that add extra features to Shiny, such as shinyjs, leaflet, shinydashboard, shinythemes, ggvis.
    • Hint: Each package is unique and has a different purpose, so you need to read the documentation of each package in order to know what it provides and how to use it.
  • Show the number of results found whenever the filters change. For example, when searching for whiskey between 40-80 proof, the app would show the text “We found 54 options for you”.
    • Hint: Add a textOutput() to the UI, and in its corresponding renderText() use the number of rows in the filtered() object.
  • Allow the user to download the results table as a .csv file.
    • Hint: Look into the downloadButton() and downloadHandler() functions.
  • Allow the user to search for multiple alcohol subtypes simultaneously, instead of being able to choose only wines/beers/etc.
    • Hint: There are two approaches to do this. Either change the typeInput radio buttons into checkboxes (checkboxGroupInput()) since checkboxes support choosing multiple items, or change typeInput into a select box (selectInput()) with the argument multiple = TRUE to support choosing multiple options.

Option B - create a new Shiny app

This app can use an entirely different dataset. Perhaps write an app to explore the gapminder dataset, or use your own data set (maybe you collected it for another assignment). The sky is the limit here, so be creative! Or be simple to minimize your workload over the next week. But the more creative your effort, the more points awarded.

Expectations for your app

Regardless of which option you select, you must do the following 4 things:

  1. Your app should be split into a ui.R file and a server.R file. Note that so far in class we only had our apps inside an app.R file. You can read this official Shiny help page if you need more help with this part.
  2. Your app should be deployed online on shinyapps.io. Make sure your app actually works online (sometimes your app will work in RStudio but will have errors on shinyapps.io - make sure you deploy early and often to make debugging easier).
  3. Update the README.md file in your homework repo. In it you should describe your app and add a link to the URL where the app is hosted.
  4. Include the code for your Shiny app in your repository so we can evaluate it.

Submit the assignment

Your assignment submission includes two components:

  1. A working Shiny app hosted on shinyapps.io
  2. A GitHub repo that includes the underlying source code which created the app.

Follow instructions on homework workflow. As part of the pull request, you’re encouraged to reflect on what was hard/easy, problems you solved, helpful tutorials you read, etc.


Check minus: The deployed app does not work or results in many errors. There is no README file describing what the app does.

Check: Shiny app runs. The README file describes either a new app or 3+ additions to our Virginia ABC store app. Whatever is described in the README is actually implemented in the app.

Check plus: Amazing Shiny app. Lots of new features or a very cool new app idea. App looks great visually.

This work is licensed under the CC BY-NC 4.0 Creative Commons License.