This is an interactive map of officer involved shootings that resulted in fatalities in Austin, TX from 2000-2014.
https://data.austintexas.gov/Public-Safety/Officer-Involved-Shooting-2000-2014/63p6-iegi
library(stringr)
library(leaflet)
library(dplyr)
library(lubridate)
df <- read.csv("Officer_Involved_Shooting.csv")
df$latlng <- str_extract(df$Location_1, "\\(.*$")
df$lat <- as.numeric(gsub(".*\\((.*),.*", "\\1", df$latlng))
df$lng <- as.numeric(gsub(".*\\,(.*)\\).*", "\\1", df$latlng))
df$my_date <- date(mdy_hms(df$Date))
my_popup <- paste(df$Location.Address,
"<br>", df$my_date,
"<br>Subject age:", df$Age..subj.,
"<br>Subject gender:", df$Gender..subj.,
"<br>Subject race:", df$Race.Ethnicity..subj.,
"<br>Officer race:", df$Race.Ethnicity..ofc.)
my_map <- df %>%
filter(!is.na(latlng), Injuries..subj. == "killed") %>%
leaflet() %>%
addTiles() %>%
addMarkers(lat = ~lat, lng = ~lng, popup = my_popup)
my_map