fortify.map {ggplot2} | R Documentation |
This function turns a map into a data frame that can more easily be plotted with ggplot2.
## S3 method for class 'map' fortify(model, data, ...)
model |
map object |
data |
not used by this method |
... |
not used by this method |
if (require("maps")) { 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")) }