Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

UI.R completion


The only thing remaining to do in order to have a fully functional application is display the outputs in UI.R. As it was explained before, each render variable has a corresponding output counterpart. Back to our example, as explained in the following sections this is how UI.R is completed.

UI.R

As it has been explained, every output name corresponds to an object in the output list created in server.R:

library(shiny)

# Starting line
shinyUI(fluidPage(
 
 # Application title
 titlePanel("Adult Dataset"),
 
 sidebarLayout(
   
   # Sidebar
   
   sidebarPanel(
     h1("Gender"),
     checkboxGroupInput("gender", "Choose the genders",
     choices = levels(data.adult$sex),
     selected = levels(data.adult$sex)),
     h1("Age"),
     sliderInput("minage", "Select lower limit", min(data.adult$age), max(data.adult$age), value = min(data.adult$age), step = 1),
     sliderInput("maxage", "Select upper limit", min(data.adult$age), max(data.adult$age), value = max(data.adult$age), step...