2. Links for downloads
• R direct link
Windows: https://cran.ma.imperial.ac.uk/bin/windows/base/R-3.5.0-win.exe
MAC: https://cran.ma.imperial.ac.uk/bin/macosx/R-3.5.0.pkg
• R studio:
• Windows: https://download1.rstudio.org/RStudio-1.1.453.exe
• MAC: https://download1.rstudio.org/RStudio-1.1.453.dmg
• This presentation and Codes:
http://bit.ly/RShinyCourse
• Our Linkedin profiles:
Eduardo Contreras https://www.linkedin.com/in/eduardocontrerasc/
Michael Mortenson https://www.linkedin.com/in/michael-mortenson-44321832/
5. Motivation
SELECTED ITEMS FROM THE AGILE MANIFESTIO
(http://agilemanifesto.org/principles.html):
• Our highest priority is to satisfy the customer through early and continuous
delivery of valuable software
• Welcome changing requirements, even late in development. Agile processes
harness change for the customer's competitive advantage
• Working software is the primary measure of progress
• Simplicity--the art of maximizing the amount of work not done--is essential
8. What will be covered?
▪ Load data from CSV
▪ Output data in a Table
▪ Plot data and filter source
▪ Calculate a logistic regression
▪ Testing the model
▪ Alternative models
▪ Upload to Google Cloud (and server settings)
9. What do you need to use R Shiny?
▪ R Studio
▪ Shiny libraries
▪ Other useful libraries
▪ Plotly: Interactive Graphics
▪ DT: Data tables outputs
▪ Dplyr: Data Transformations
▪ Rpart: Decision Trees
▪ e1071: Support Vector Machines
10. How does it works?
▪ It has two main components
▪ The User Interface (UI)
▪ The Server
11. The basics
▪ We will use Shinydashboard, makes it easy to use Shiny
▪ Lets Run the App by opening the R file and click in Run APP
12. The basics
▪ The dashboard has three parts: header, sidebar and body
16. Time to explore the App
▪ Install libraries
▪ Load the Excel File
▪ Explore the dataset
▪ Plot only “Married” customers
▪ Calculate the logistic regression
▪ Download the Results
21. Where to learn more…
• R programming
https://www.datacamp.com/courses/free-introduction-to-r
• Free Shiny Interactive Tutorial
https://www.datacamp.com/courses/building-web-applications-in-r-with-shiny
• More tricks of Shinydashboard and actions
https://rstudio.github.io/shinydashboard/structure.html
http://shiny.rstudio.com/gallery/widget-gallery.html
• Gallery of plots with code
https://plot.ly/r/
• Useful data transformations with Dplyr and Tidyr
https://dplyr.tidyverse.org/
https://blog.rstudio.com/2014/07/22/introducing-tidyr/
Editor's Notes
127.0.0.1 is the IP address your laptop uses for itself (it’s the same as ‘localhost’).
Your laptop is hosting a web page (the UI) whose content is controlled by a running R session.
When you run an app through RStudio, that R session is also running the server on your laptop.
The server responds when you interact with the web page, processing R commands and updating UI objects accordingly.
The user interface and the server interact with each other through input and output objects. The user’s interaction with input objects alters parameters in the server’s instructions – instructions for creating output objects shown in the UI.
Writing an app requires careful attention to how your input and output objects relate to each other, i.e. knowing what actions will initiate what sections of code to run at what time.