fifty_states_inset_boxes: Add inset box borders

Description Usage Details Value Examples

View source: R/fiftystater.R

Description

Border boxes for the insets of Alaska and Hawaii in fifty_states can be added to the map with this function.

Usage

1

Details

Adding the result of this function to your ggplot will add a layer with border boxes to highlight the insets. It draws data from the package data object fifty_states_inset_boxes_data and creates a layer to plot the borders with annotate.

Value

A ggplot2 layer object with path data to draw the inset border boxes

Examples

1
2
3
4
5
6
7
if(require("mapproj") && require("ggplot2")) {
  crimes <- data.frame(state = tolower(rownames(USArrests)), USArrests)
  ggplot(crimes, aes(fill = UrbanPop, map_id = state)) +
    geom_map(map = fifty_states) +
    expand_limits(x = fifty_states$long, y = fifty_states$lat) +
    coord_map() + fifty_states_inset_boxes()
}

wmurphyrd/fiftystater documentation built on May 4, 2019, 9:45 a.m.