Created
March 14, 2014 17:46
-
-
Save jcheng5/9552922 to your computer and use it in GitHub Desktop.
Navbar example
License: MIT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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