Motive/Background
This Shiny app is part of the Data Products course project under John Hopkins University’s 10-course Data Science Specialization. The goal of this assignment was for students to get comfortable with using the Shiny package in R to build interactive apps. Students were free to use any data they wanted in order to display reactive outputs given user inputs.
I decided to create a (very ) simple and straightforward dashboard that charts the average price and total volume of avocados sold across the state of California over three years of data.
Data
The data used for this app/dashboard comes from a Kaggle dataset by user Justin Kiggins, which is originally sourced from the Hass Avocado Board.
To keep the app simple, I decided to only use the data limited to the state of California (California produces ~95% of the avocados grown in the US, and ~10% of the entire world’s production!). Additionally, I decided to focus only on the average price and total volume metrics to plot as charts.
Note: Each row/observation of the data is taken one week apart from one another.
App
Click the link below to view and use the app!
The app is fairly straightforward to use, and has some documentation detailing everything you need to know to get started using it.
First, select which type of avocado data you would like to view (conventional vs. organic). Then, you can filter the data by regions of California (or view the entire state). Lastly, you can control what time frame you would like the view the charts in, giving the user control to investigate certain years or months of interest. As the user filters what data they would like to use/see, the charts react dynamically.
The charts are stacked on top of each other deliberately, so that users can easily observe corresponding changes or trends in volume with respect to the average price of any date.
Dashboard Preview
Below is a screenshot preview of the dashboard for convenience:
Code
Click here to view the code for the server side of the Shiny app
Click here to view the code for the UI of the Shiny app