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/.
A data frame with 75 rows representing cities and 8 variables:
Number of police officers serving that city
Percentage of the total police force that lives in the city
Percentage of white (non-Hispanic) police officers who live in the city
Percentage of non-white police officers who live in the city
Percentage of black police officers who live in the city
Percentage of Hispanic police officers who live in the city
Percentage of Asian police officers who live in the city
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:
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.
The census data is estimated from 2006 to 2010; police forces may have changed in size since then.
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.
# To convert data frame to tidy data (long) format, run: library(dplyr) library(tidyr) police_locals_tidy <- police_locals %>% gather(key = "race", value = "perc_in", all:asian)