Description Usage Arguments Examples
Create a data frame of map data.
1 |
map |
name of map provided by |
region |
name of subregions to include. Defaults to |
exact |
should the |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require("maps")
require("ggplot2")
states <- map_data("state")
arrests <- USArrests
names(arrests) <- tolower(names(arrests))
arrests$region <- tolower(rownames(USArrests))
choro <- merge(states, arrests, sort = FALSE, by = "region")
choro <- choro[order(choro$order), ]
qplot(long, lat, data = choro, group = group, fill = assault,
geom = "polygon")
qplot(long, lat, data = choro, group = group, fill = assault / murder,
geom = "polygon")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.