Data processing

As you write more and more complex programs, it's the server.R file that will become the largest because this is where all the data processing and output goes, and is even where some of the functions that handle advanced UI features live. Let's look at the chunks in order and talk about the work carried out in each section.

The first chunk of code looks like the following:

library(tidyverse)library(gapminder)library(leaflet)library(ggmap)

You can see the packages that we need being loaded at the top. We load the tidyverse for access to things such as dplyr and ggplot, for munging data and plotting, respectively. The gapminder package is used to load a subset of the gapminder data. It has been very kindly munged and placed ...

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.