Tutorial scripts with R/Shiny basics
This project accompanies BernR Meetup: Shiny from basics to awesome in 26 minutes, Monday, October 14, 2019.
The tutorial uses following packages:
shiny
for building interactive appsmagrittr
to provide a pipe operatorshinycssloaders
to provide loader animations (spinners)shinyBS
to provide popups and alerts
The tutorial covers a basic shiny app with enhancements:
app-step1.R
implements a basic app to plot a histogram of Gaussian-distributed numbers with adjustable number of binsapp-step2.R
adds a selection field to choose the sample size from a predefined listapp-step3.R
adds a debounce function to slow down the reactive sliderapp-step4.R
adds a loader animation (a spinner) fromshinycssloaders
packageapp-step5.R
adds alert popups fromshinyBS
packageapp-step6.R
adds help popups and tooltips fromshinyBS
package
Apps can be launched:
- from within RStudio by clicking Run App button in the upper right corner of the editor window
- from command line by executing
R -e "shiny::runApp('app-step1.R', port = 6969)"
and then pointing your browser to http://127.0.0.1:6969. The value of theport
parameter can be changed to suit your needs.