This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output, session) { | |
tmpData <- reactive({ | |
modFlights %>% | |
filter(name %in% input$carrierName) | |
}) | |
output$delayRange <- renderUI({ | |
max_delay <- max(tmpData()$dep_delay) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output, session) { | |
output$delayRange <- renderUI({ | |
max_delay <- max(modFlights$dep_delay) | |
sliderInput('delayFlightRange', | |
label = "Choose delay range (minutes):", | |
min = 0, max = max_delay, | |
value = c(0, max_delay), step = 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output, session) { | |
dayFilteredData <- reactive({ | |
modFlights %>% | |
filter(name %in% input$carrierName) %>% | |
group_by(name, hour) %>% | |
summarise(delayed_flight_perc = sum(dep_delay > input$delayFlightRange[1] & | |
dep_delay < input$delayFlightRange[2] & | |
distance > input$distance_val) / | |
sum(distance > input$distance_val)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output, session) { | |
output$ddelay_plot <- renderPlot({ | |
aggDelayFlights <- modFlights %>% | |
filter(name %in% input$carrierName) %>% | |
group_by(name, hour) %>% | |
summarise(delayed_flight_perc = sum(dep_delay > input$delayFlightRange[1] & | |
dep_delay < input$delayFlightRange[2] & | |
distance > input$distance_val) / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(shiny) | |
library(nycflights13) | |
library(ggplot2) | |
library(ggthemes) | |
options(scipen = 999) | |
flights <- flights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fluidPage( | |
titlePanel(title = "Introduction to Shiny"), | |
sidebarPanel( | |
selectInput("carrierName", | |
label = "Select carrier:", | |
choices = sort(chosenCarrier$name), | |
selected = sort(chosenCarrier$name)[1], | |
multiple = T), | |
sliderInput('delayFlightRange', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fluidPage( | |
titlePanel(title = "Introduction to Shiny"), | |
sidebarPanel( | |
selectInput("carrierName", | |
label = "Select carrier:", | |
choices = sort(chosenCarrier$name), | |
selected = sort(chosenCarrier$name)[1], | |
multiple = T), | |
sliderInput('delayFlightRange', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
options(shiny.autoreload = TRUE) | |
shinyServer(function(input, output) { | |
output$distPlot <- renderPlot({ | |
x <- faithful[, 2] | |
bins <- seq(min(x), max(x), length.out = input$bins + 1) | |
NewerOlder