Skip to content

Instantly share code, notes, and snippets.

@drewhoener
Created April 26, 2020 21:07
Show Gist options
  • Save drewhoener/55638bf7d7ea707216942541651f6a84 to your computer and use it in GitHub Desktop.
Save drewhoener/55638bf7d7ea707216942541651f6a84 to your computer and use it in GitHub Desktop.
library(shiny)
library(ggplot2)
library(plyr)
library(dplyr)
data <- read.csv("workbook.csv", stringsAsFactors = FALSE) #subset dataframe to reactive dataframe to input slider
ui <- fluidPage(
titlePanel("Ambient Particulate Matter"),
sidebarLayout(
sidebarPanel(
sliderInput("sampleInput", "Choose a sample size:", min = 1, max = 134, value = c(25, 100), pre = " ")
),
mainPanel(
plotOutput("coolplot"), dataTableOutput("coolstats"), tableOutput("coolstats2"))
)
)
server <- function(input, output) {
output$coolstats <- renderDataTable({
data[input$sampleInput[1]:input$sampleInput[2],]
})
}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment