17 Dec 2016
3 files that live in the same folder
=> let's build our first app!
library(shiny)
shinyUI(fluidPage(
titlePanel("A random normal"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("obs",
"Number of obs:",
min = 1,
max = 1000,
value = 100)
),
mainPanel(
plotOutput("randomPlot")
)
)
))
<a href="http://somedestination.com">some link</a> <b>this is bold</b> <i>this is italic</i> <div class="some-class">a class with a style</div>
=> shiny functions create these wraps for us.
shinyServer(function(input, output) {
output$randomPlot <- renderPlot({
hist(rnorm(input$obs),
col = 'darkgray',
border = 'white')
})
})
This course: dashboard structure
library(shinydashboard) dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody() )