O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To create interactive web applications with shiny, perform the following steps:

  1. Get a feel for shiny by examining a dummy application with no functionality. The folder called DummyApp in your R working directory contains the ui.R and server.R files with the following code:
# ui.R  
library(shiny) 
shinyUI(pageWithSidebar(    
   headerPanel("Dummy Application"),    
   sidebarPanel(     h3('Sidebar text')   ),    
   mainPanel(       h3('Main Panel text')   ) )) 
 
#server.R   
library(shiny) 
shinyServer(function(input,output) { } ) 
  1. Run the application using runApp("DummyApp"). If you have the files loaded in the code pane in RStudio, click on Run App.
  2. The SimpleApp directory in your R working directory contains the ui.R and server.R files with the following code: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required