Description Usage Arguments Examples
Create a layer of map borders.
1 2 |
database |
map data, see |
regions |
map region |
fill |
fill colour |
colour |
border colour |
... |
other arguments passed onto |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | require("maps")
require("ggplot2")
ia <- map_data("county", "iowa")
mid_range <- function(x) mean(range(x))
seats <- ddply(ia, .(subregion), colwise(mid_range, .(lat, long)))
ggplot(ia, aes(long, lat)) +
geom_polygon(aes(group = group), fill = NA, colour = "grey60") +
geom_text(aes(label = subregion), data = seats, size = 2, angle = 45)
data(us.cities)
capitals <- subset(us.cities, capital == 2)
ggplot(capitals, aes(long, lat)) +
borders("state") +
geom_point(aes(size = pop)) +
scale_area()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.