## Not run:
# library(shiny)
#
# ## Single-file app using Bootstrap 2 ===========================
# shinybootstrap2::withBootstrap2({
# shinyApp(
# ui = fluidPage(
# numericInput("n", "n", 1),
# plotOutput("plot")
# ),
# server = function(input, output) {
# output$plot <- renderPlot( plot(head(cars, input$n)) )
# }
# )
# })
#
#
# ## App with server.R and UI. R =================================
# ## ui.R
# shinybootstrap2::withBootstrap2({
# fluidPage(
# selectInput("ui", "Input type", choices = c("numeric", "slider")),
# uiOutput("n_ui"),
# plotOutput("plot")
# )
# })
#
# ## server.R
# # In server.R, it's only necessary to wrap code in withBoostrap2()
# # when renderUI() is used.
# shinybootstrap2::withBootstrap2({
# function(input, output) {
# output$n_ui <- renderUI({
# if (input$ui == "numeric")
# numericInput("n", "n", 1)
# else if (input$ui == "slider")
# sliderInput("n", "n", 1, 10, value = 1)
# })
# output$plot <- renderPlot( plot(head(cars, input$n)) )
# }
# })
#
# ## End(Not run)
Run the code above in your browser using DataLab