Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- aqi = read.csv(file = "C:/Users/stan/Desktop/205410185/1.csv",
- header = T, sep = ",")
- colnames(aqi) = c("date", "AQI",
- "PM10","PM2.5")
- ui = fluidPage(
- titlePanel('AIR'),
- sidebarLayout(
- sidebarPanel( selectizeInput("AIR",
- "Select Contaminant:",
- choices = c("AQI",
- "PM2.5",
- "10"),
- selected = "AQI",
- multiple = TRUE )
- ),
- mainPanel(
- plotOutput("plot")
- )
- )
- server = function(input, output) {
- output$plot = renderPlot({
- ggplot(aqi) +
- geom_line(mapping = aes(x = date, y = aqi[,input$AIR], colour = input$AIR)) +
- labs (x = "date", y = "aqi", title = "AIR") +
- scale_colour_discrete(name = "AIR")
- })
- }
- shinyApp(ui, server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement