stl_tbl_murders: City of St. Louis Murders, 2008-2016

Description Usage Format Source References Examples

Description

A data set containing murders for the years 2008 through 2016 in the City of St. Louis.

Usage

1

Format

A tibble with 1394 rows and 11 variables:

id

SLMPD record number

fullDate

string date in dmy format for when murder occurred

year

year murder occurred

month

month murder occurred

day

day of month murder occurred

time

time murder occurred in 24-hour clock

descrip

HOMICIDE

district

SLMPD district where murder occurred

nhood

neighborhood where murder occurred, see for values

address

house address where murder occurred

street

street where murder occurred

Source

St. Louis Metropolitan Police Department; original data cleaning and data set construction by Taylor Braswell

References

Asher, J. (2017, January 9). U.S. Cities Experienced Another Big Rise In Murder In 2016. FiveThiryEight, retrived from website.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
str(stl_tbl_murders)
head(stl_tbl_murders)

if (require("dplyr") & require("ggplot2")) {

  # what is the neighborhood with the most murders?
    stl_tbl_murders %>%
      group_by(nhood) %>%
      summarize(n_obs = n()) %>%
      arrange(desc(n_obs))

    # top neighborhoods: 50 is Wells Goodfellow and 59 is Jeff Vanderlou

  # how have murders changed over time?
    stl_tbl_murders %>%
      group_by(year) %>%
      summarize(n_obs = n()) %>%
      arrange(year) %>%
      ggplot(aes(x = year, y = n_obs)) +
        geom_bar(stat="identity") +
        scale_x_continuous(breaks = c(2008:2016),
          labels = factor(2008:2016))

}

chris-prener/stlData documentation built on June 5, 2019, 2:51 p.m.