Week 8: Interactive Applications - Shiny
Schedule [BB]
-
8:30 - 9:00 recap
- grades updated on GauchoSpace
- schedule:
- NO CLASS next week
- NO office hours for BB this week, on again March 8th or by email
- This assignment due next Thursday, March 10
- final project presentations Friday, March 11
- quick intro to package development
-
9:00 - 9:45 Shiny demo. If unavailable, you can run locally with the following:
setwd('~/Downloads') # change to sensible directory download.file('https://github.com/ucsb-bren/env-info/archive/gh-pages.zip','env-info-gh-pages.zip') unzip('env-info-gh-pages.zip') rmarkdown::run('env-info-gh-pages/wk08_shiny/shiny_demo.Rmd')
-
9:45 - 10:00 break
-
9:45 - 10:30 Shiny slides
-
10:30 - 11:30 tutorials, assignment
- Run through Shiny Tutorial lessons, placing shiny files in folders contained in the
env-info_hw
directory of your<user>.github.io
repository. I recommend starting RStudio with the R project corresponding to your<user>.github.io.Rproj
. - Create a Shiny app for your group in your
<org>.github.io
repo (see Group below).
- Run through Shiny Tutorial lessons, placing shiny files in folders contained in the
Assignment
- Create a normal Rmarkdown HTML document
wk08_shiny.Rmd
in theenv-info_hw
folder of your<user>.github.io
repository.
Individual
In your wk08_shiny.Rmd
, add:
-
R chunk with option
eval=F
containing theshiny::runGitHub()
command to run at least one of the examples from the Shiny Tutorial after you pushed your app files to your<user>.github.io
repository on Github. -
Link to the shinyapps.io URL of a Shiny app that you published.
Group
Create group Shiny app in your <org>.github.io
repo to enhance your previous interactive visualization by adding user interface and server functions that enable a user to:
-
subset rows (ie
filter()
) or columns (ieselect()
) of the data -
alter at least one parameter to the visualization
In your individual http://<user>.github.io/env-info_hw/wk08_shiny.html
, similarly include:
-
R chunk with option
echo=F
containing theshiny::runGitHub()
command to run your group’s Shiny app in the<org>.github.io
repository. -
Link to the shinyapps.io URL of the Shiny app that one of your group members published.
Submit URL to GauchoSpace
In order to get credit for this assignment, you must log into GauchoSpace and submit the URL into the wk08_shiny assignment.
This URL should be to the wk08_shiny.html
in your <user>.github.io
, NOT <org>.github.io
and NOT wk08_shiny.Rmd
. For instance, for me that would be http://bbest.github.io/env-info_hw/wk08_shiny.html
.
Note: I am adding this GauchoSpace submission part because some students invariably mistype the filenames, forget to push to Github, or some such. This extra step hopefully ensures that I can easily find your homework and give you credit.
I’ll be out of country next week so won’t have office hours. We’re cancelling class for Bren Group Project presentations next week. I will have office hours again Tuesday March 8th 11:30 - 1pm. This assignment is due Thursday, March 10th.
Resources
- Shiny Cheat Sheet
- Building Shiny apps - an interactive tutorial: slides, text and demo
- Shiny Lesson 6. Use reactive expressions
- Shiny Gallery
- Shiny Articles
- Supplementing your R package with a Shiny app
- Rmarkdown: Interactive Documents, Embedded Shiny Apps
- Examples from 2016-01-25 eco-data-science/shiny_tutorial at NCEAS: