Simple and elegant deployment of analytics on the web using RStudio and Shiny
- May 10, 2019
- 525 views
I’ve been using the R language for several years to perform data analysis and I recently had an opportunity to “test drive” RStudio’s Shiny Web deployment tool. The description of Shiny is concise, “Makes it incredibly easy to build interactive web applications with R. Automatic "reactive" binding between inputs and outputs and extensive prebuilt widgets make it possible to build beautiful, responsive, and powerful applications with minimal effort.”, which peaked my curiosity because nothing to do with R seems “easy”.
I started by viewing the Shiny tutorial produced by Garrett Grolemund. This is a fast paced, but extremely effective introduction on how to build a Shiny app. After 30 minutes of watching the video I felt confident that I could construct a “simple” Shiny app, using R scripts I already have implemented. The next step was to install the Shiny R package in my RStudio application, which I already have installed. The installation was flawless and I was on my way to creating my first Shiny app. The transformation from a simple R script into a Shiny app was relatively straight forward, using the Shiny app.R template available in the tutorials. Now it was simply a matter of defining the web/html interface UI using the Shiny UI objects and defining the server side function to populate the web output. After a few syntax errors were resolved I had a working Shiny app running on my computer. Not bad for about 1 hour’s work.
RStudio folks also provide a website called shinyapps.io where people can upload their Shiny apps, making them accessible to the internet. So the next step was to deploy my nice new Shiny app on the shinyapps.io website, which is accomplished entirely within RStudio, after setting up an account on shinyapps.io. With my account setup I was ready to deploy my new app, which only takes one command from within RStudio: rsconnect::deployApp() and after a few minutes you receive the URL of your new Shiny app running on the shinyapps.io server. Here is the link to my first Shiny App: https://reallc.shinyapps.io/ISONESolar/
To summarize, I found the RStudio Shiny package to be very intuitive and straight forward to use. The tutorial and documentation are both excellent and there seems to be a robust Shiny user community. I found it to be very easy to build and deploy simple Shiny apps from existing R scripts that I already had around. Congratulations to the RStudio/Shiny development team for producing such a fine piece of software engineering and customer friendly software. It really was easy, just like it said in the description.