mapfill: Draw map and fill regions

Description Usage Arguments Details

View source: R/mapfill.R

Description

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

Usage

1
2
3
mapfill(x, map, fill, id = intersect(names(x), names(map)), id.name = id,
  border = "grey95", ticks = FALSE, labels = FALSE, label.filter = TRUE,
  ...)

Arguments

x

data frame with fill values

map

a map of type SpatialPolygonsDataFrame

fill

name of field in x containing fill values

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.

...

additional parameters passed to geom_text

Details

Draws a map with regions shaded based on values provided in a dataframe.


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