The student-app data visualization is a simple app built with R Shiny. This app analyzes 1,000 students' high school GPA, SAT scores, and first year of university GPA. The raw data is availble via OpenIntro Statistics.
Execute the following commands in R to install the app's required libraries.
install.packages("shiny")
install.packages("magrittr")
install.packages("ggplot2")
I cleaned the data by using gsub() to transform "1" to "Male" and "2" to "Female."
- Open a new .R script
- Copy paste the script from Pastebin here.
- Run script
- Try adding the following script to the UI:
titlePanel("Congratulations, you've created a new app!")
- Erase script
- Copy paste new script from Pastebin here
- Run script
- If you're familar with HTML5, try experimenting with font in the UI:
mainPanel(
h2("main panel"))
- Erase script
- Copy paste new script from Pastebin here
- Run script
- Defer back to original SAT Shiny app. Try adding two additional selectInput() widgets to the UI.
- Fill in the appropriate labels and make sure to change textOutput to plotOutput. This will render your renderText function useless, but we'll change that later. Your completed UI should look like this.
Resource: Widget gallery
- Erase script
- Copy paste new script from Pastebin here
- Defer back to original SAT Shiny app. Remember: what you input in the UI must have an output in the server.
- Run script
- Congratulations! You've created your first app.
Resources: Reactive expressions