Learn R Programming

tmap (version 1.0)

qtm: Quick thematic map plot

Description

Draw a thematic map quickly.

Usage

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

Arguments

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

Value

item

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

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.

See Also

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

Examples

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

# just the map
qtm(Europe)

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

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

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

# bubble map
qtm(World, borders = NA) + qtm(metro, bubble.size = "pop2010", bubble.col="purple", 
    bubble.title.size="Metropolitan Areas", theme = "World", bubble.scale=.5)

Run the code above in your browser using DataLab