Chapter 6 Time Matters
In this chapter we provide a brief introduction into spatio-temporal visualisation. The importance of place in criminology and crime analyses is widely recognised and is the central topic of this book. However, taking into consideration time is just as important as place. We often hear that crime is "going up" or "going down" over time. These variations on the levels of crime along time also vary across space. These variations across both time and place are called spatio-temporal variations, and are of crucial importance for crime analysis, explanation, and prevention.
Traditionally, the temporal and spatial analyses of crime are not introduced in a combined manner. Although a great deal of energy has been devoted to produce accessible training material for crime analysts on geographic information systems and spatial analysis, most criminology degrees (even at Postgraduate level) and training packages for crime analysis devote a very limited (if any) content to the appropriate visualisation and analysis of temporal and spatio-temporal data. Therefore, before we discuss the spatio-temporal, we have to introduce a few key ideas and concepts about temporal crime analysis.
In this chapter, we will therefore give a very high-level overview of temporal crime analysis, before moving on to ways in which we can display spatio-temporal variation in our data using maps. The key concepts covered in this chapter are:
-
an introduction to temporal data in crime analysis,
-
cleaning and wrangling temporal data,
-
visualising time data,
-
time series and its three components: trend, seasonality, and random variation,
-
visualising spatio-temporal variation.
We will be making use of the following R packages:
# Basic reading and data carpentry
library(readr)
library(dplyr)
library(lubridate) # adds functionality for better handling of temporal data
# Packages for handling spatial data
library(sf)
library(spacetime)
# General visualisation and ggplot plugins for temporal data
library(ggplot2)
library(ggfortify)
library(ggTimeSeries)
library(ggseas)
library(gganimate)
library(tmap)
