Skip to content

Instantly share code, notes, and snippets.

@jcheng5
Created March 14, 2014 17:46
Show Gist options
  • Save jcheng5/9552922 to your computer and use it in GitHub Desktop.
Save jcheng5/9552922 to your computer and use it in GitHub Desktop.
Navbar example License: MIT
shinyServer(function(input, output, session) {
output$plot <- renderPlot({
plot(cars, type=input$plotType)
})
output$summary <- renderPrint({
summary(cars)
})
output$table <- renderDataTable({
cars
}, options=list(iDisplayLength=10))
})
library(markdown)
shinyUI(navbarPage("Navbar!",
tabPanel("Plot",
sidebarLayout(
sidebarPanel(
radioButtons("plotType", "Plot type",
c("Scatter"="p", "Line"="l")
)
),
mainPanel(
plotOutput("plot")
)
)
),
tabPanel("Summary",
verbatimTextOutput("summary")
),
navbarMenu("More",
tabPanel("Table",
dataTableOutput("table")
),
tabPanel("About",
fluidRow(
column(6,
includeMarkdown("about.md")
),
column(3,
img(class="img-polaroid",
src=paste0("http://upload.wikimedia.org/",
"wikipedia/commons/9/92/",
"1919_Ford_Model_T_Highboy_Coupe.jpg")),
tags$small(
"Source: Photographed at the Bay State Antique ",
"Automobile Club's July 10, 2005 show at the ",
"Endicott Estate in Dedham, MA by ",
a(href="http://commons.wikimedia.org/wiki/User:Sfoskett",
"User:Sfoskett")
)
)
)
)
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment