UK Annual Driver Deaths: An Interactive Plotting App

Matt Heimdahl
11-10-2019

Introduction

This Shiny app allows the user to select an annual date range between 1969 and 1984 to see annual trends in driver casualties (deaths and serious injuries) in Great Britain.

Time Range Widget

The user can adjust the time period shown in the plot by using the slider widget:

plot of chunk widget

The widget will create a line plot showing annual trends in UK driver casualties for the years selected. plot of chunk plot

Code for user interface object

library(shiny)

shinyUI(fluidPage(
    titlePanel("Trends in UK Driver Deaths"),     
        sidebarPanel(
            sliderInput("Years",
                        "Date Range:",
                        min = 1969,
                        max = 1984,
                        value = c(min,max), sep = "", width = 2000)),
        mainPanel(
            plotOutput("linePlot"))))