Coding Assignment 1
Overview
In this assignment, you will create a modified version of the democracy scatter plot app we made in class. You will use the vdemdata
package to download data from the Varieties of Democracy project and use it to create an app that allows users to explore the relationship between two sets of variables. You can choose the theme of your app. It does not have to be about democracy and development per se.
There will be two differences in this app relative to the one we did in class. First, the two sets of variables (X and Y) will be separate. Second, you will add a third widget that will control the viridis color theme for the scatter plot. If you change the theme, you may also want to change the title panel.
Be sure to reference the V-Dem codebook to understand the variables you are using.
Step 1: Plan Your App (15%)
Before you start coding, write out a plan for your app. What variables will be on your X axis? What variables will be Y axis variables? What will the user interface look like? What will the server logic do? Etc. Write your plan in words in the space below.
Step 2: Wrangling (15%)
Start a new Shiny App. In the folder you created, start a new R script. Now use the dplyr package or other handy methods to wrangle the data into a format that is ready for plotting and write the CSV file to the folder. Remember that for this app the USER will be selecting which year to plot.
Step 3: Create the Setup Portion of the App (20%)
Load the packages that you will need for the app and create the variable lists that you will use in the UI. You will also need to load the data you created in the previous step.
Step 4: Create the User Interface (20%)
Create the user interface for the app. This should include the title, the X and Y axis variable selectors, and the viridis color scheme selector. You will also need to create a plot output.
Step 5: Create the Server Logic (20%)
Create the server logic for the app. This should include the reactive expression that will filter the data based on the user’s selections and the renderPlot() function that will create the plot. Make sure that your labels also change along with the updated data.
Step 6: Deploy Your App (10%)
Once you have it working, deploy your app to shinyapps.io. Share the link with the class. Then submit your folder to the Dropbox link listed below.
After you share your link with the class, please also submit your code to me via this link.