Content
- Choropleth Mapping with in R
- Type of choropleth map
- Choosing number of classes
- Data classification methods
- Selecting colour scheme
- tmap Methods
- tmap framewok
- tmap elements
- tmap layers
- tmap layout
- tmap style
- tmap facet
School of Computing and Information Systems,
Singapore Management University
13 Nov 2023
A choropleth map is a type of thematic map in which areas are shaded or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population or per-capita income.
Caution
Avoid equal interval if your data are skewed to one end or if you have one or two really large outlier values. Outliers in that case will likely produce empty classes, wasting perfectly good classes with no observations in them. Since the hotel data above doesn’t have really large outliers, this is a data distribution that works well with equal interval.
Two approaches can be used to prepare thematic map using tmap, they are:
Plotting a thematic map quickly by using qtm()
.
Plotting highly customisable thematic map by using tmap elements.
qtm()
The easiest and quickest to draw a choropleth map using tmap is using qtm()
. It is concise and provides a good default visualisation in many cases.
tmap_mode()
with “plot” option is used to produce a static map. For interactive mode, “view” option should be used.
fill
argument is used to map the attribute (i.e. DEPENDENCY)
tm_shape()
tm_shape()
, which specifies the shape object.tm_polygons()
, tm_symbols()
, tm_lines()
, tm_raster()
and tm_text()
Each aesthetic can take a constant value or a data variable name. For instance, tm_fill(col="blue")
colors all polygons blue, while tm_fill(col="var1")
, where “var1” is the name of a data variable in the shape object, creates a choropleth.
The supported derived layers are as follows:
Core Reading
Additional Readings