Advertisement
Guest User

Untitled

a guest
Aug 26th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. library(shiny)
  2.  
  3. # Define UI for application that draws a histogram
  4. ui <- fluidPage(
  5.  
  6. # Application title
  7. titlePanel("Testing app"),
  8.  
  9. # Sidebar with a slider input for number of bins
  10. sidebarLayout(
  11. sidebarPanel(
  12. sliderInput("Year",
  13. "Select year:",
  14. min = as.Date("2012-01-01"),
  15. max = as.Date("2013-01-01"),
  16. value = as.Date("2012-01-01"),
  17. timeFormat = "%Y",
  18. step = 365,
  19. animate = animationOptions(interval = 1000))
  20. ),
  21.  
  22. # Show a plot of the generated distribution
  23. mainPanel(
  24. textOutput("sampleText")
  25. )
  26. )
  27. )
  28.  
  29. # Define server logic required to draw a histogram
  30. server <- function(input, output) {
  31.  
  32. output$sampleText <- renderText({
  33. paste0("You have selected: ",input$Year)
  34. })
  35. }
  36.  
  37. # Run the application
  38. shinyApp(ui = ui, server = server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement