The UI

If you can, download and run the code and data from (the data goes in the same folder as the code) so you can get an idea of what everything does. If you want to run the program without copying the actual data and code to your computer (copying data and code is preferable so that you can play with it), just use another function to share and run applications (we will discuss this in Chapter 5, Easy JavaScript and Custom JavaScript Functions), as shown in the following code:

runGitHub("gapminder", "ChrisBeeley")

As in many Shiny applications, ui.R is by far the simpler of the two code files, and is as follows:

library(shiny)library(leaflet)fluidPage(   titlePanel("Gapminder"),

The first thing that we do ...

Get Web Application Development with R Using Shiny - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.