Package 'USAboundaries'

Title: Historical and Contemporary Boundaries of the United States of America
Description: The boundaries for geographical units in the United States of America contained in this package include state, county, congressional district, and zip code tabulation area. Contemporary boundaries are provided by the U.S. Census Bureau (public domain). Historical boundaries for the years from 1629 to 2000 are provided form the Newberry Library's 'Atlas of Historical County Boundaries' (licensed CC BY-NC-SA). Additional data is provided in the 'USAboundariesData' package; this package provides an interface to access that data.
Authors: Lincoln Mullen [aut, cre] , Jordan Bratt [aut] , United States Census Bureau [cph]
Maintainer: Lincoln Mullen <[email protected]>
License: MIT + file LICENSE
Version: 0.4.0
Built: 2024-07-12 05:32:36 UTC
Source: https://github.com/ropensci/USAboundaries

Help Index


Install the USAboundariesData package after checking with the user

Description

Install the USAboundariesData package after checking with the user

Usage

install_data_package()

State codes and abbreviations for U.S. states and territories

Description

This data frame includes abbreviations and codes for states and territories in the United States. It is intended as a lookup table.

Usage

state_codes

Format

A data.frame with 69 rows and 4 variables:

state_name

The state or territory name

state_abbr

The two character abbreviation for the state or territory.

state_code

A three digit numeric FIPS code for the state or territory.

jurisdiction_type

One of state, territory, or district.

References

U.S. Census Bureau, U.S. Gazeteer Files (2014).

Federal Information Processing Standard state code, Wikipedia (accessed July 23, 2015).


Projections from the State Plane Coordinate System

Description

Get EPSG codes or PROJ.4 codes for projections from the State Plane Coordinate System.

Usage

state_plane(state, plane_id = NULL, type = c("epsg", "proj4"))

Arguments

state

The postal code for the state.

plane_id

The state plane geographic zone identifier. A NULL value will return a projection for the entire state.

type

The type of output to return: either an EPSG code or PROJ4 string.

Value

Either a PROJ4 string as a character vector or an EPSG code as an integer.

See Also

For documentation of the underlying State Plane Coordinate System projection data frame, see state_proj.

Examples

if (require(USAboundariesData)) {
  state_plane(state = "MA", type = "epsg")
  state_plane(state = "MA", type = "proj4")
  state_plane(state = "MA", plane_id = "island", type = "epsg")
  state_plane(state = "MA", plane_id = "island", type = "proj4")

  # Show the difference made by a state plane projection
  if (require(sf)) {
    va <- us_states(states = "VA", resolution = "high")
    plot(st_geometry(va), graticule = TRUE)
    va <- st_transform(va, state_plane("VA"))
    plot(st_geometry(va), graticule = TRUE)
  }
}

Data for projections from the State Plane Coordinate System

Description

This data frame includes state abbreviations, EPSG codes, and proj4 strings for projections from the State Plane Coordinate System.

Usage

state_proj

Format

A data frame with 123 rows and 5 variables:

state

The state or territory abbreviation.

zone

Name of the state plane zone.

epsg

The EPSG code for each state plane zone.

proj4_string

The PROJ4 string for the state plane projection.

statewide_proj

State plane zone for projecting the entire state.

References

State Plane Coordinate System


U.S. state boundaries

Description

The U.S. Census Bureau provides cartographic boundary files for current U.S. boundaries. This package has only the low-resolution contemporary state boundaries. Other census boundary files are provided by and documented in the USAboundariesData package.

Usage

states_contemporary_lores

Format

An object of class sf (inherits from data.frame) with 52 rows and 13 columns.

See Also

For citations for the other Census boundary files provided by the USAboundariesData package, see the census_boundaries documentation in that package.


City locations and populations (historical and contemporary)

Description

This function returns an sf object of cities (or populated places) with their populations and latitudes and longitudes. Population data is taken from the U.S. Census.

Usage

us_cities(map_date = NULL, states = NULL)

Arguments

map_date

If NULL, then city populations from the 2010 census (the most recent census) are returned. This parameter accepts a Date object or a character string coercible to a Date object, as well as numeric values representing a year. If a year or date is used, then city populations from the decennial census from 1790 to 2010 prior to that year is returned. For example, 1805 or "1805-07-04" would return city populations from the 1800 census.

states

A character vector of state or territory names or abbreviations. Only boundaries for those states/territories will be returned. If NULL, all boundaries will be returned.

References

The data was compiled by Erik Steiner and Jason Heppler at the Center for Spatial and Textual Analysis, Stanford University. See their description of the data for a fuller accounting of how the data was gathered.

Examples

if (require(USAboundariesData)) {
  us_cities(1805)
  us_cities("1828-05-08")
  us_cities()
}

Congressional district boundaries (contemporary)

Description

Get the current (2020) boundaries for U.S. Congressional districts.

Usage

us_congressional(resolution = c("low", "high"), states = NULL)

Arguments

resolution

The resolution of the boundaries.

states

A character vector of state or territory names. Only boundaries inside these states/territories will be returned. If NULL, all boundaries will be returned.

Value

An sf object.

See Also

For documentation of and citation to the underlying shapefiles for contemporary data from the U.S. Census Bureau, see the census_boundaries help file in the USAboundariesData package.

Examples

if (require(USAboundariesData) && require(sf)) {
  us_congressional <- us_congressional()
  va_congressional <- us_congressional(states = "Virginia", resolution = "high")
  plot(st_geometry(us_congressional))
  plot(st_geometry(va_congressional))
}

County boundaries (contemporary and historical)

Description

Get the current (2020) boundaries for U.S counties from the U.S. Census Bureau, or get historical county boundaries for dates between 30 December 1636 and 31 December 2000.

Usage

us_counties(map_date = NULL, resolution = c("low", "high"), states = NULL)

Arguments

map_date

The date of the boundaries as some object coercible to a date with as.Date(); the easiest option is a character vector following the ISO 8601 data format. If NULL (the default) the contemporary boundaries will be returned.

resolution

The resolution of the map.

states

A character vector of state or territory names or abbreviations. Only boundaries for those states/territories will be returned. If NULL, all boundaries will be returned.

Value

An sf object.

See Also

For documentation of and citation to the underlying shapefiles for contemporary data from the U.S. Census Bureau, see the census_boundaries help file in the USAboundariesData package. For documentation of and citation to the underlying shapefiles for historical data from the Atlas of Historical County Boundaries, see the ahcb_boundaries help file in the USAboundariesData package.

Examples

if (require(USAboundariesData) && require(sf)) {
  contemporary_us  <- us_counties()
  historical_us    <- us_counties("1820-07-04")
  contemporary_ne  <- us_counties(states = c("Massachusetts", "Vermont", "Maine",
                                             "New Hampshire", "Rhode Island",
                                             "Connecticut"))
  historical_ne    <- us_counties("1803-04-28",
                                  states = c("Massachusetts", "Vermont", "Maine",
                                             "New Hampshire", "Rhode Island",
                                             "Connecticut"),
                                  resolution = "high")

  plot(st_geometry(contemporary_us))
  plot(st_geometry(historical_us))
  plot(st_geometry(contemporary_ne))
  plot(st_geometry(historical_ne))
}

State boundaries (contemporary and historical)

Description

Get the current (2020) boundaries for U.S states from the U.S. Census Bureau, or get historical state boundaries for dates between 3 September 1783 and 31 December 2000.

Usage

us_states(map_date = NULL, resolution = c("low", "high"), states = NULL)

Arguments

map_date

The date of the boundaries as some object coercible to a date with as.Date(); the easiest option is a character vector following the ISO 8601 data format. If NULL (the default) the contemporary boundaries will be returned.

resolution

The resolution of the map.

states

A character vector of state or territory names or abbreviations. Only boundaries for those states/territories will be returned. If NULL, all boundaries will be returned.

Value

An sf object.

See Also

For documentation of and citation to the underlying shapefiles for contemporary data from the U.S. Census Bureau, see census_boundaries documentation in the USAboundariesData package. For documentation of and citation to the underlying shapefiles for historical data from the Atlas of Historical County Boundaries, see the ahcb_boundaries documentation in the USAboundariesData package.

Examples

contemporary_us <- us_states()

if (require(USAboundariesData) && require(sf)) {
  historical_us   <- us_states("1820-07-04")
  contemporary_ne <- us_states(states = c("Massachusetts", "Vermont", "Maine",
                                          "New Hampshire", "Rhode Island",
                                          "Connecticut"))
  historical_ne   <- us_states(as.Date("1805-03-12"),
                               states = c("Massachusetts", "Vermont", "Maine",
                                          "New Hampshire", "Rhode Island",
                                          "Connecticut"),
                               resolution = "high")
   plot(st_geometry(contemporary_us))
   plot(st_geometry(historical_us))
   plot(st_geometry(contemporary_ne))
   plot(st_geometry(historical_ne))
}

Zip Code Tabulation Areas (contemporary)

Description

Get the current (2019) centroids for U.S Zipcode Tabulation Areas from the U.S. Census Bureau. The centroids were calculated from the ZCTA boundary files available on the U.S. Census Bureau website.

Usage

us_zipcodes()

Value

An sf object.

See Also

For documentation of and citation to the underlying shapefiles for contemporary data from the U.S. Census Bureau, see the census_boundaries documentation in the USAboundariesData package.

Examples

if (require(USAboundariesData)) {
  us_zipcodes()
}

USAboundaries: Historical and Contemporary Boundaries of the United States of America

Description

This package provides contemporary (2014) boundaries for states, counties, zip code tabulation areas, and congressional districts in the United States of America. This data is provided by the U.S. Census Bureau.

Details

This package also provides spatial objects with historical boundaries of states or counties in the United States of America from 1629 to 2000. It provides data from the Atlas of Historical County Boundaries. The copyright to the historical data used in this package is owned by the Newberry Library, and it is included in the USAboundariesData package under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Generic (CC BY-NC-SA 2.5) license.

The code in this package is copyrighted by Lincoln Mullen, and is released under the terms of the MIT License.