police_locals: Most Police Don't Live In The Cities They Serve

Description Usage Format Details Source Examples

Description

The raw data behind the story "Most Police Don't Live In The Cities They Serve" https://fivethirtyeight.com/features/most-police-dont-live-in-the-cities-they-serve/.

Usage

1

Format

A data frame with 75 rows representing cities and 8 variables:

city

U.S. city

force_size

Number of police officers serving that city

all

Percentage of the total police force that lives in the city

white

Percentage of white (non-Hispanic) police officers who live in the city

non_white

Percentage of non-white police officers who live in the city

black

Percentage of black police officers who live in the city

hispanic

Percentage of Hispanic police officers who live in the city

asian

Percentage of Asian police officers who live in the city

Details

The dataset includes the cities with the 75 largest police forces, with the exception of Honolulu for which data is not available. All calculations are based on data from the U.S. Census.

The Census Bureau numbers are potentially going to differ from other counts for three reasons:

  1. The census category for police officers also includes sheriffs, transit police and others who might not be under the same jurisdiction as a city's police department proper. The census category won't include private security officers.

  2. The census data is estimated from 2006 to 2010; police forces may have changed in size since then.

  3. There is always a margin of error in census numbers; they are estimates, not complete counts.

Note: Missing values means that there are fewer than 100 police officers of that race serving that city.

Source

See https://github.com/fivethirtyeight/data/tree/master/police-locals

Examples

1
2
3
4
5
# To convert data frame to tidy data (long) format, run:
library(dplyr)
library(tidyr)
police_locals_tidy <- police_locals %>%
   pivot_longer(all:asian, names_to = "race", values_to = "perc_in")

Example output

Some larger datasets need to be installed separately, like senators and
house_district_forecast. To install these, we recommend you install the
fivethirtyeightdata package by running:
install.packages('fivethirtyeightdata', repos =
'https://fivethirtyeightdata.github.io/drat/', type = 'source')

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

fivethirtyeight documentation built on Oct. 7, 2021, 5:09 p.m.