USAboundaries (version 0.3.1)

us_boundaries: Get historical or contemporary boundaries of the United States

Description

This function is a general-purpose wrapper around the more specific functions in this package. It is provided for convenience and backward-compatibility with earlier versions of the package. In most cases you should use the more specific functions for the type of boundary that you need.

Usage

us_boundaries(map_date = NULL, type = c("state", "county", "congressional"),
  resolution = c("low", "high"), states = NULL)

Arguments

map_date

The date of the boundaries as some object coercible to a date with as.Date(). For state maps the date must be between 3 September 1783 and 31 December 2000; for county maps the date must be between 30 December 1636 and 31 December 2000. A NULL value will return contemporary boundaries. This value is ignored for types of boundaries other than states and counties.

type

The type of the map, either state, county, or congressional.

resolution

The resolution of the map. High resolution data is contained in the suggested package USAboundariesData. If that package is not available, you will be prompted to install it.

states

A character vector of state or territory names. Only boundaries for these states/territories will be returned.

Value

An sf object.

See Also

us_states, us_counties, us_congressional

Examples

Run this code
# NOT RUN {
if (require(USAboundariesData) && require(sf)) {
  map_states   <- us_boundaries("1850-07-04")
  map_counties <- us_boundaries(as.Date("1850-07-04"), type = "county")
  new_england <- c("Massachusetts", "Vermont", "New Hampshire", "Connecticut",
                   "Rhode Island", "Maine")
  map_ne <- us_boundaries("1943-02-12", states = new_england)
  map_congressional <- us_boundaries(type = "congressional",
                                   states = new_england)

  plot(st_geometry(map_states))
  plot(st_geometry(map_counties))
  plot(st_geometry(map_ne))
  plot(st_geometry(map_congressional))
}

# }

Run the code above in your browser using DataLab