“Hello World” Program with Shiny in R

To run shiny programs, you need two files in the same directory:

  1. ui.R
  2. server.R
ui.R


# A shiny code requires two files: ui.R and server.R
# This code will be saved as ui.R


library(shiny) # call the Library to load into R
shinyUI(pageWithSidebar(
headerPanel(“Introduction to Shiny”),
sidebarPanel(
h4(‘Hello World’)
),
mainPanel(
h3(‘Text that goes in the main panel’)
)
))

server.R
# A shiny code requires two files: ui.R and server.R
# This code will be saved as server.R
library(shiny) # call the Library to load into R
shinyServer(
function(input, output) {
}
)

 

To run a shiny program type > runApp()

Output:

Shiny Hello World

 

Learn more about Shiny at https://class.coursera.org/devdataprod-004

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *