Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shinydashboard)
- library(shiny)
- library(ggplot2)
- library(gridExtra)
- library(dplyr)
- library(tidyverse)
- library(lubridate)
- ui <- dashboardPage(
- dashboardHeader(title = "T"),
- dashboardSidebar(),
- dashboardBody(
- fluidRow(
- box(
- title = "Controls",
- selectInput("User",
- "User:",
- c("All",
- unique(as.character(df$User))))
- ),
- box(
- dateRangeInput("dates",
- "Date range",
- start = "01-01-2018",
- end = "06-25-2018")
- ),
- mainPanel(
- tabsetPanel(type = "tabs",
- tabPanel("Plot", plotOutput("plot")
- )
- )
- )
- )
- )
- )
- server <- function(input, output){
- df <- read.csv(file = "c:/T/T/T.csv", header = TRUE, sep = ",")
- df$Date <- as.Date(df$Date)
- begin<- reactive({input$dates[1]})
- finish<- reactive({input$dates[2]})
- output$plot <- renderPlot({
- df.filtered<-df %>%
- filter(df$User == input$User) %>%
- filter(Date >= begin(), Date <= finish())
- req(df.filtered)
- df.filtered
- })
- }
- shinyApp(ui, server)
Add Comment
Please, Sign In to add comment