The UI

If you can, download and run the code and data from github.com/ChrisBeeley/gapminder (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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.