Chapter 3 Mapping Rates and Counts
In Chapter 1 we showed you fairly quickly how to create maps by understanding how data may have spatial elements, and how that can be linked to geometries. In this chapter instead we will get to know how to think about thematic maps, and how to apply your learning to creating your own maps of this variety. In the process we will discuss various types of thematic maps and the issues they raise.
Thematic maps focus on representing the spatial pattern of a variable of interest (e.g., crimes, trust in the police, etc.) and they can be used for exploration and analysis or for presentation and communication to others. There are different types of thematic maps depending on how the variable of interest is represented. In this and the next chapters, we will introduce some of these types of particular interest for crime analysis, the different challenges they pose, and some ideas that may help you to choose the best representation for your data. Critically, we need to think about the quality of the data we work with, for adequate measurement is the basis of any data analysis.
We will introduce in particular two common types of thematic maps used for mapping quantitative variables: choropleth (thematic) maps and proportional symbol maps. In previous chapters we introduced two separate packages for creating maps in R (
ggplot2 and leaflet). Here we will introduce a third package for creating maps: tmap. The libraries we use in this chapter are as follow:
# Packages for reading data and data carpentry
library(readr)
library(dplyr)
library(janitor)
# Packages for data exploration
library(skimr)
# Packages for handling spatial data and for geospatial carpentry
library(sf)
# Packages for mapping and visualisation
library(tmap)
library(tmaptools)
# Packages for spatial analysis
library(DCluster)
# Packages with spatial datasets
library(geodaData)
