Skip to content

Instantly share code, notes, and snippets.

@ckholmes5
Created August 4, 2016 15:46
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 ckholmes5/1e1ad19cfa58f3d1fba6611a7fa6e91e to your computer and use it in GitHub Desktop.
Save ckholmes5/1e1ad19cfa58f3d1fba6611a7fa6e91e to your computer and use it in GitHub Desktop.
graphInput = reactive({
if (input$lineG == "total") {
line = total_fatal
}
if (input$lineG == 'drunk') {
line = dd_fatal
}
if (input$lineG == 'distract') {
line = distract_fatal
}
if (input$lineG == 'speeding') {
line = speeding_fatal
}
line = line[line$YEAR >= input$lineRange[1] & line$YEAR <= input$lineRange[2],]
})
output$trendPlot = renderPlotly({
p = plot_ly(graphInput(), x = YEAR, y = FATALS)
layout(p, yaxis = list(range = c(0, 50000)),autotick = F)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment