Graphics Reference
In-Depth Information
Figure 13-33. Specific regions from the world map
If there is a separate map available for a region, such as nz (New Zealand), that map data will
be at a higher resolution than if you were to extract it from the world map, as shown in Fig-
ure 13-34 :
# Get New Zealand data from world map
nz1 <- map_data( "world" , region = "New Zealand" )
nz1 <- subset(nz1, long > 0 & lat > -48 ) # Trim off islands
ggplot(nz1, aes(x = long, y = lat, group = group)) + geom_path()
# Get New Zealand data from the nz map
nz2 <- map_data( "nz" )
ggplot(nz2, aes(x = long, y = lat, group = group)) + geom_path()
Search WWH ::




Custom Search