Learn R Programming

tmap (version 1.2)

qtm: Quick thematic map plot

Description

Draw a thematic map quickly.

Usage

qtm(shp, fill = NA, bubble.size = NULL, bubble.col = NULL, text = NULL,
  text.size = 1, text.col = NA, line.lwd = NULL, line.col = NULL,
  raster = NA, borders = NA, scale = NA, title = NA, format = NULL,
  style = NULL, ...)

Arguments

shp
shape object, which is one of
  1. SpatialPolygons(DataFrame)

Value

item

  • fill
  • bubble.size
  • bubble.col
  • text
  • text.size
  • text.col
  • line.lwd
  • line.col
  • raster
  • borders
  • scale
  • title
  • format
  • style
  • ...

code

fill.style

Details

This function is a convenient wrapper of the main plotting method of stacking tmap-elements. The first argument is a shape object (normally specified by tm_shape). The next arguments, from fill to raster, are the aesthetics from the main layers. The remaining arguments are related to the map layout. Any argument from any main layer can be specified (see ...). It is also possible to stack tmap-elements on a qtm plot. See examples. For format any character value, say "xxx" can be used if the wrapper function "tm_format_xxx" exists. The same applies for the arguments colors, and style.

See Also

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

Examples

Run this code
data(Europe, World, metro)

# just the map
qtm(Europe)

# choropleth
qtm(World, fill = "economy", text="iso_a3", text.size = "AREA", format = "World", 
	fill.title="Economy", style="col_blind")

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

qtm(World, fill="HPI", fill.n=9, fill.palette="div", fill.auto.palette.mapping=FALSE, 
	fill.title="Happy Planet Index", format="World", style="gray")

# bubble map
qtm(World, borders = NULL) + qtm(metro, bubble.size = "pop2010", 
    bubble.title.size="Metropolitan Areas", bubble.scale=.5, format = "World")

Run the code above in your browser using DataLab