After quarantine procedures were put in place in Maryland, I became interested in how the COVID-19 pandemic had affected crime in Baltimore City.

In COVID-19 & Baltimore Crime: Part 1, I saw that as instances of cornovirus increase in MD, reported crime decreased.

For the second part of the project, I decided to research some of the major COVID-related events that had taken place in March and layer them over my crime graph for additional context.

At 4pm the evening of 12 March, Governor Larry Hogan announced that mass gatherings of more than 250 people were now prohibited. Additionally, telework was now mandatory for all non-essential state employees, all senior citizen activity centers were closed, and the cruise terminal at the Port of Baltimore closed. Visits to correctional facilities were terminated, and (probably the biggest thing) public schools were scheduled to be closed for two weeks for intenstive cleaning. {1}

At this point in time, crime levels seem fairly consistent with the prior year. Then we see what appears to be the start of a new trend, right around March 16th.

What happened on that date? It was the first day that all public schools were closed (temporarily at this time). Additionally, an announcement made that day closed all bars and restaurants (for sit-down traffic), fitness centers, gyms, and spas. {2}

Looking at the highlighted point on the graph to the left, we can see that the number of reported crimes dropped dramatically that day, from 141 crimes in 2019 to 100 crimes in 2020.

From this point onward, reported crime generally decreases for the rest of the month, with a few spikes. We see one big spike on March 17th, and my personal guess is that people were outside more for St. Patrick’s Day. Perhaps this resulted in more opportunities for crime?

It’s interesting to note that this drastic change in reported crime occurred prior to the implementation of the shelter in place order, later given on March 30th {3}.

This implies that even the less stringent social distancing policies enacted during March had a marked effect on reported city crime levels.

We’ll see if this trend continues throughout April.

How did I make my graphs?

The graphs for this article were started in my previous article, COVID-19 & Baltimore Crime: Part 1.

In this article, I added annotations and zoomed in on an area of interest. See the commented code below to see how this was done:

#Packages used
library(tidyverse)#contains ggplot2 for graphs
library(gridExtra)#for arranging side-by-side plots
library(knitr)#r markdown package
library(ggthemes)#gives different plot themes
#Graph of march 2019 crime vs march 2020 crime

#importing March 2020 crime data from openbaltimore.gov
crime <- read.csv("~/Google Drive/R/Projects/COVID-19/crime_data/BPD_Part_1_Victim_Based_Crime_Data_mar2020.csv", stringsAsFactors = TRUE)

names(crime)[1]<-"Date" #renaming date col
crime$Date<-as.Date(crime$Date, format = "%m/%d/%Y") #converting date format
crime_count<-crime %>% group_by(Description) %>% tally()
daily_crime<-crime %>% group_by(Date) %>% tally()# determining number crimes occurring by date

#importing March 2019 crime data from openbaltimore.gov
crime19<-read.csv("~/Google Drive/R/Projects/COVID-19/crime_data/BPD_Part_1_Victim_Based_Crime_Data_mar2019.csv", stringsAsFactors = TRUE)
names(crime19)[1]<-"Date"
crime19$Date<-as.Date(crime19$Date, format = "%m/%d/%Y")
#summary tables of crimes in 2019
crime19_count<-crime19 %>% group_by(Description) %>% tally()
daily_crime19<-crime19 %>% group_by(Date) %>% tally()# number crimes occurring by date


daily_crime$Date<-format(daily_crime$Date, format="%m/%d")
daily_crime19$Date<-format(daily_crime19$Date, format="%m/%d")

#Joining '19 and '20 data together into one dataframe
all<-daily_crime19 %>% full_join(daily_crime, by = "Date")

names(all)[2]<-"Count2019"#renaming cols
names(all)[3]<-"Count2020"
all$Date<-as.Date(all$Date,"%m/%d")

#creating my own color blind-friendly colors list
colors<-c("2019"="#10A0BA" , "2020"="#D81B60", "mar16"="yellow")

#making a new df so I can create a column of numbers to use instead of the date columns (easier to maniuplate numbers rather than dates for the annotations)
all2<-all
all2$num<-c(1:31)

#put group=1 to deal with "each group has only 1 observation" error
p3<-ggplot(data=all2, aes(x=factor(num), group=1)) + geom_line(aes(y=Count2019, color="2019")) +
  geom_line(aes(y=Count2020, color="2020")) +
  scale_color_manual(values=colors, name=NULL) +
  labs(title="Baltimore Crime in March ", caption= "Source: data.baltimorecity.gov", x=NULL, y="No. of Reported Crimes")

#Adding in the arrow annotations. End of arrow is the observation coords
p3<-p3+annotate(geom = "curve", x=9, y=78, xend = 12, yend= 97, curvature=.2, arrow=arrow(length=unit(2,"mm")))+
  annotate(geom="text", x=5, y=76, label="Mass gatherings limited", hjust="left")+
  annotate(geom="curve", x=13, y=125, xend=16, yend=100, curvature=-0.3, arrow=arrow(length =  unit(2,"mm")))+
  annotate(geom="text", x=7.5, y=128, label="Schools Closed", hjust="left")+
  annotate(geom="curve", x=25, y=145, xend=30, yend=95, curvature=-0.1, arrow=arrow(length=unit(2,"mm")))+
  annotate(geom="text", x=19, y=147, label="Shelter in Place", hjust="left")+
  scale_x_discrete(breaks=c("5", "10", "15", "20", "25", "30"), labels=c("3/5", "3/10", "3/15", "3/20", "3/25", "3/30"))+
  scale_y_continuous(breaks=seq(50,160,25))
p3

#Zooming in on March 16th data

# create a df subset containing the observation to be highlighted
a <- subset(all2, all2$num == "16")

p4<-ggplot(data=all2, aes(x=factor(num), group=1)) + geom_line(aes(y=Count2019, color="2019")) +
  geom_line(aes(y=Count2020, color="2020")) +
  scale_color_manual(values=colors, name=NULL) +
  coord_cartesian(xlim=c(13,18))+  #zooming in by reducing x limit
  labs(title="Zooming in on March 16th ", caption= "Source: data.baltimorecity.gov", x=NULL, y="No. of Reported Crimes")+
  scale_x_discrete(breaks=c("12","13","14","15","16","17","18"), labels=c("3/12","3/13", "3/14", "3/15", "3/16", "3/17", "3/18"))+
  scale_y_continuous(breaks=seq(50,160,25))+
  geom_point(aes(x=a$num , y=a$Count2020), color="#F0E442", size=3)# the highlighted point
p4