inst/examples/numericRange/app.R

library(shiny)
library(shinyWidgets)


# Define the UI
ui <- bootstrapPage(
  numericRangeInput('mpg', 'mpg range:', value = mtcars$mpg),
  plotOutput('plot')
)


# Define the server code
server <- function(input, output) {
  output$plot <- renderPlot({
    x <- mtcars[mtcars$mpg >= input$mpg[1] & mtcars$mpg <= input$mpg[2],]
    barplot(table(x$cyl))
  })
}

# Return a Shiny app object
shinyApp(ui = ui, server = server)

Try the shinyWidgets package in your browser

Any scripts or data that you put into this service are public.

shinyWidgets documentation built on Aug. 30, 2023, 5:17 p.m.