Baltimore Crime in Day and Night
Some crimes in the Charmed City happen “in plain daylight” while others happen mostly at dark, but is there a real difference or just a perceived one?
I got curious and decided to look at some of the Baltimore City open data on crime. Then I got the idea of analyzing it to see if some crimes were more likely to happen in the daytime than at night. For this, I was going to need data on when sunrise and sunset happened in Baltimore. Lucky for me, someone had already gotten curious about getting sunrise/sunset data on a specific location. All I had to do was adapt their code and make some pretty graphs.
First, the data. Head on over to the Open Baltimore portal and download a data set on Part 1 Crime. I downloaded it as a .csv file, which makes it easy to load into R.
d <- read_csv("baltimore_crime_data.csv")
The data I downloaded goes from January 1, 2016, to October 31, 2021. It has all sorts of interesting data in there on a lot of crime.
t.1 <- table(d$Description)
kable(t.1)|Var1 | Freq|
|:--------------------|-----:|
|AGG. ASSAULT | 32049|
|ARSON | 966|
|AUTO THEFT | 22854|
|BURGLARY | 34018|…