ui.R

Let's take a look at the ui.R file first:

fluidPage(  tags$head(HTML("<link href='http://fonts.googleapis.com/css?family=Jura'  rel='stylesheet' type='text/css'>")),  h2("Custom HTML", style = "font-family: 'Jura';  color: green; font-size: 64px;"),  sidebarLayout( sidebarPanel( radioButtons("country", "Country",  c("Afghanistan", "Bahrain", "Cambodia")) ),  mainPanel(  h3("Time series"), HTML("<p><em>Life expectancy</em> over time</p>"), plotOutput("plotDisplay"), htmlOutput("outputLink") ) )) 

There's a quick method of styling text inline in this example. First, let's fetch a font from Google Fonts, which you can see by simply using the tags$ function to generate an HTML <head> and then placing the link inside, as shown in the following ...

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.