Graphics Reference
In-Depth Information
If you want to draw a map of a region in the world map for which there isn't a separate map,
you can first look for the region name, like so:
sort(unique(world_map$region))
"Afghanistan"
"Albania"
"Algeria"
"American Samoa"
"Andaman Islands"
"Andorra"
"Angola"
"Anguilla"
"Antarctica"
...
"USA"
"USSR"
"Vanuatu"
"Venezuela"
"Vietnam"
"Virgin Islands"
"Vislinskiy Zaliv"
"Wales"
"West Bank"
"Western Sahara"
"Yemen"
"Yugoslavia"
"Zaire"
"Zambia"
"Zimbabwe"
# You might have noticed that it's a little out of date!
It's possible to get data for specific regions from a particular map ( Figure 13-33 ):
east_asia <- map_data( "world" , region = c( "Japan" , "China" , "North Korea" ,
"South Korea" ))
# Map region to fill color
ggplot(east_asia, aes(x = long, y = lat, group = group, fill = region)) +
geom_polygon(colour = "black" ) +
scale_fill_brewer(palette = "Set2" )
Search WWH ::




Custom Search