In this recipe, we will learn how to plot data on regional maps within individual countries rather than the whole world map. We will look at examples based on the United States and European countries.
Just as with the previous recipe, we will make use of the
maps package to draw the map and the
RColorBrewer package to choose color schemes. So, let's make sure that they are loaded:
We will use the inbuilt
USArrests example dataset, which contains crime statistics, in arrests per 100,000 residents for assault, murder, and rape in each of the 50 US states in 1973.
Let's plot the arrests rate for murders in US states in 1973. The default graphics device ...