<iframe src="https://exploratory.io/viz/Hidetaka-Ko/5c323e488b27?embed=true" frameborder="0" width="100%" height="100%" > </iframe>
# Set libPaths.
.libPaths("/Users/HidetakaKo/.exploratory/R/3.3")
# Load required packages.
library(lubridate)
library(tidyr)
library(urltools)
library(stringr)
library(readr)
library(broom)
library(RcppRoll)
library(tibble)
library(dplyr)
library(exploratory)
# Data Analysis Steps
read_delim("/Users/HidetakaKo/Desktop/ucr_crime_1975_2015.csv" , ",", quote = "\"", skip = 0 , col_names = TRUE , na = c("","NA"), n_max=-1 , locale=locale(encoding = "ASCII", decimal_mark = ".") , progress = FALSE) %>%
exploratory::clean_data_frame() %>%
gather(crime_type, crim_sum, homs_sum, rape_sum, rob_sum, agg_ass_sum, violent_crime, na.rm=TRUE) %>%
mutate(year_since_joined = (2016 - year)) %>%
group_by(crime_type, year) %>%
summarize(counts=sum(crim_sum, na.rm=TRUE)) %>%
filter(year != 2015) %>%
mutate(total = sum(counts))
I have the data published by the Marshall project which compiled the most recent Uniform Crime Reporting numbers available on the four top crimes the FBI classifies as violent: homicide, rape, robbery, and assault, which has more than 40 years of data from 68 police jurisdictions. See this page (https://github.com/themarshallproject/city-crime) for the detail. Rape crime is the only one that has been increasing since 2012. Note: In 2013, the FBI changed how it defined rape. Until that point, rape was only counted if it was “carnal knowledge of a female forcibly and against her will.” The revised, broader definition became: “Penetration, no matter how slight, of the vagina or anus with any body part or object, or oral penetration by a sex organ of another person, without the consent of the victim.”