RHays Shiny Application and Reproducible Pitch

Homicide Rates and Electoral Vote Allocation

R Hays
03032021

Assignment Details

After creating my shiny app, now it's time to make my pitch. I get 5 slides (inclusive of the title slide) to pitch my app. I created this web page using Rstudio Presenter, with an html5 slide deck.

My presentation must satisfy the following:

It must be done in Slidify or Rstudio Presenter It must be 5 pages It must be hosted on github or Rpubs It must contained some embedded R code that gets run when slidifying the document

Shiny Application Summary

Based on data compiled by the CDC (dated noted on next slide), the average national homicide rate for 2019 was 6.16% per 100,000. The results of the 2020 Presidential Election allocated each state's electoral votes to one of the two political parties - Republican, Democratic.(US Archives data noted on next slide).

My shiny app will allow the user to select a State and view the following: which party was allocated the state's electoral votes what the 2019 homicide rate was for that state and the actual number of homicides

Data Sources and Server Configuration

CDC Homicide Data (“https://www.cdc.gov/nchs/pressroom/sosmap/homicide_mortality/homicide.html”)

National Archives Electoral Vote Data (“https://www.archives.gov/electoral-college/2020”)

Load combined data

homiciderates <- read_excel(“C:/Users/themo/OneDrive/Data Science JHU/Shiny_APP/Homicide_vs_Electoral_Vote/Homicide Rates vs Election Results.xlsx”, col_types = c(“text”, “text”, “numeric”, “numeric”, “skip”, “skip”, “skip”, “skip”, “skip”, “skip”, “skip”),skip = 1)

Define a server for the Shiny app function(input, output) {

populate the area created for the reactive table
output$ratetable <- renderTable({

    Render a reactive table
    stateFilter <- subset(homiciderates, homiciderates$STATE == input$instate) 
})

}

Shiny App Location, Github