fortify.map: Fortify method for map objects.

Description Usage Arguments Details See Also Examples

View source: R/fortify-map.r

Description

Fortify method for map objects.

Usage

1
2
## S3 method for class 'map'
 fortify(model, data, ...)

Arguments

model

map object

data

not used by this method

...

not used by this method

Details

This function turns a map into a data frame than can more easily be plotted with ggplot2.

See Also

map_data and borders

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require("maps")
require("ggplot2")

ca <- map("county", "ca", plot = FALSE, fill = TRUE)
head(fortify(ca))
qplot(long, lat, data = ca, geom = "polygon", group = group)

tx <- map("county", "texas", plot = FALSE, fill = TRUE)
head(fortify(tx))
qplot(long, lat, data = tx, geom = "polygon", group = group, 
colour = I("white"))

hadley/spatialVis documentation built on May 17, 2019, 12:47 p.m.