Skip to content

Instantly share code, notes, and snippets.

@wfkwan
Created October 18, 2020 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfkwan/a9ea84b2ebe9141f777c81a837b9a15d to your computer and use it in GitHub Desktop.
Save wfkwan/a9ea84b2ebe9141f777c81a837b9a15d to your computer and use it in GitHub Desktop.
output$delay_time <- renderPlot({
data <- setNames(annotate_agg2_es_result((es$search("kibana_sample_data_flights", delay_type_query))),
c("time", "airline", "ndelays"))
data$time <- as.POSIXct(data$time, format="%Y-%m-%dT%H:%M:%S")
data <- data[(data$time >= input$delay_time_range[1]) & (data$time <= input$delay_time_range[2]), ]
ggplot(data, aes(x=time, y=ndelays, fill=airline)) + geom_bar(stat="identity") + theme_minimal()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment