Making a Shiny App
Data
Going back to the crop data from 09/01/2020 because it has a lot of variables to work with within the Shiny framework.
Global Crop Yields
The data this week comes from Our World in Data. Note that there is a lot of data on that site, we’re looking at some subsets but feel free to use whatever data from there you find interesting! It’s all pretty clean and ready to go.
Let’s start by creating a static plot that we can extend within the Shiny app.
Using all of the countries and the eleven different types of crops, we can build a Shiny app to describe how the yields change over time.
The first chunk of Shiny code creates the interactive buttons that allow the user to specify what variables they want to use. The second chunk of Shiny code uses the input variables in the ggplot itself.
[1] "You are phenomenal!"