Question: Overview RStudio's shiny framework provides a straightforward structure for creating not just websites , but web applications . By providing R users with the ability
Overview
RStudio's shiny framework provides a straightforward structure for creating not just websites, but web applications. By providing R users with the ability to generate web-based interfaces that communicate with R servers, shiny enables developers to create dynamic platforms for data exploration.
The purpose of this assignment is to provide you with the opportunity to practice building a shiny application. Once you are comfortable with the general skeleton of these applications, transforming your analyses into interactive experiences will be nearly painless.
The Data
For this assignment, you'll be using the midwest dataset, which is built into the ggplot2 package. Each row contains demographic information about a county in each state:
Remember, you may want to use dplyr to compute (and then later visualize) summary information!
Assignment Structure
As with previous assignments, follow this link (Links to an external site.)Links to an external site. to create your own private repository for this assignment. This should automatically create a private repository which you will submit to Canvas as your assignment. Complete the following steps:
For this assignment, you build your own shiny application. The application should provide users with the ability to interact with a visual representation of the midwest dataset. What the application looks like is up to you, as long as it meets the following requirements:
- You create a multi-page (tab) application with at least two pages
- On each page, you should use the appropriate layout, such as a sidebarLayout, to create a section for control widgets, and another section for a visualization.
- You must create at least two widgets on each page that change the visual output in your application, such as data displayed on the x or y axis of a scatterplot.
- One of your widgets on each page must change the data that is being displayed. For example, the attribute being shown on the x or y axis. While changing the color of all markers (from, say, red to blue) would not meet this requirement, changing the data driving the color of each point would (i.e., color by percent poverty or population density)
- You must create a visual representation of a dataset that reacts to the widgets on each page
- You must host your application up to the shinyapps.io server, making it publicly usable
- The layout is well structured (clear headers, panels, etc.), and includes at least 3 custom CSS styles.
As you know, in order to run a shiny application, you must create multiple files:
- A ui.R file, that drives the structure of the user interface
- A server.R file, that provides instructions to the R server
- A README.md file, because it's important to document your code. This file should contain a link to your project.
The purpose of this project really is just to make sure you're comfortable with the structure of a web application. Feel free to be creative in your assignment, though a scatter-plot with 2 widgets controlling the x variable and y variable would be sufficient.
Widgets
You should create at least two widgets of your choice for each visualization. As stated above in the requirements, at least one of these widgets should change the data being displayed.
Visual representation
On each page (tab) of your application, you must have a visualization of the midwest dataset. The visualization can be made with base ggplot2, plotly (Links to an external site.)Links to an external site., or something less supported but more interesting (Links to an external site.)Links to an external site.. While we don't expect you to create anything ground-breaking, we do expect you to create a clear visualization with proper labels, titles, and interactions (if using and interactive library). And of course, the graphic needs to react to changing values in the widgets.
Expectations
At this point in the quarter, we expect you to be following the best practices we've incorporated into the class. This means:
- Proper use of libraries such as dplyr for data wrangling
- Structuring your code so that if the data changes, you can easily update your entireapplication
- Clearly commenting and properly organizing your code
- Linting your code for any errors
- Writing functions to encapsulate chunks of code that you use more than once
- Avoiding the creation of variables that are unnecessary for your analysis/report
- Creating appropriate labels for your visualizations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
