Description Usage Arguments Details See Also Examples
Fortify method for map objects.
1 2 |
model |
map object |
data |
not used by this method |
... |
not used by this method |
This function turns a map into a data frame than can more easily be plotted with ggplot2.
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.