Learn R Programming

tmap (version 0.7)

qtm: Quick thematic map plot

Description

This function is a convenient wrapper for drawing thematic maps quickly.

Usage

qtm(shp, fill = "grey85", bubble.size = NULL, bubble.col = NULL,
  text = NULL, text.cex = 1, line.lwd = NULL, line.col = NULL,
  borders = "grey40", theme = NULL, scale = NA, ...)

Arguments

shp
fill
either a color to fill the polygons, or name of the data variable in shp to draw a choropleth.
bubble.size
name of the data variable in shp for the bubblemap that specifies the sizes of the bubbles. If neither bubble.size nor bubble.col is specified, no bubblemap is drawn.
bubble.col
name of the data variable in shp for the bubblemap that specifies the colors of the bubbles. If neither bubble.size nor bubble.col is specified, no bubblemap is drawn.
text
Name of the data variable that contains the text labels.
text.cex
Font size of the text labels. Either a constant value, or the name of a numeric data variable.
line.lwd
either a line width or a name of the data variable that specifies the line width. Only applicable if shp is a SpatialLines or
line.col
either a line color or a name of the data variable that specifies the line colors. Only applicable if shp is a SpatialLines or
borders
color of the polygon borders. Use NA to omit the borders.
theme
one of "World", "Europe", or "NLD"
scale
numeric value that serves as the global scale parameter. All font sizes, bubble sizes, border widths, and line widths are controled by this value. The parameters bubble.size, text.cex, and line.lwd can be scaled sepe
...
arguments passed on to the tm_* functions. If an argument name is not unique for a particular tm_ function, then it should be prefixed with the function name without "tm_". For instance, style is an argu

Value

See Also

../doc/tmap-nutshell.html{vignette("tmap-nutshell")}

Examples

Run this code
data(Europe)
data(World)
data(cities)

# just the map
qtm(Europe)

# choropleth
qtm(World, fill = "economy", text="iso_a3", text.cex = "AREA", 
	fill.palette="-Blues", theme = "World", title="Economy")

qtm(Europe, fill="gdp_cap_est", text="iso_a3", text.cex="pop_est", 
    title="GDP per capita", fill.textNA="Non-European countries")

qtm(World, fill="pop_est_dens", theme="World", fill.style="kmeans", title="Population per km")

# bubble map
qtm(World, borders = NA) + qtm(cities, bubble.size = "pop_max", bubble.col="purple", 
	title="Cities of the World", theme = "World", bubble.scale=.5)

Run the code above in your browser using DataLab