mapspot: Draw map and add bubbles

Description Usage Arguments Details

View source: R/mapspot.R

Description

Use ggplot2 to draw a map and fill regions of the map based on values in a dataframe.

Usage

1
2
3
4
mapspot(x, map, fill, size, id = intersect(names(x), names(map)),
  id.name = id, border = "grey95", ticks = FALSE, labels = FALSE,
  label.filter = TRUE, lab.size = 3, regions = "white", max_size = 6,
  size.label = comma, ...)

Arguments

x

data frame with fill values and bubble sizes

map

a map of type SpatialPolygonsDataFrame

fill

name of field in x containing fill values

size

name of field in x containing the size values (mapped to size aesthetic).

id

name of field in x containing map region id values. Defaults to the first field name x and map have in common

id.name

name of field in mapdata containing region names used for (optional) region labelling

border

colour of region borders

ticks

a logical value indicating whether tick marks should be added to axes. Defaults to FALSE.

labels

a logical value indicating whether regions should be labelled. Defaults to FALSE

label.filter

string to be evaluated in the context of 'x' which determines whether a given region will be labelled.

lab.size

size of region label text

regions

colour of map regions

max_size

maximum size of bubbles

size.label

label formatter defaults to comma

...

additional parameters passed to geom_text

Details

Draws a map.


seancarmody/rmapaus documentation built on May 29, 2019, 4:26 p.m.