Shapefiles for the Contiguous United States of America

Data package containing shapefiles for the US that may easily be restricted to only the contiguous US. Shapefiles are provided for; states, congressional districts and counties. All shapefiles have the resolution of 1:20,000,000 and are from the US Census Bureau - < https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html>. State/County/District information has been combined from multiple disjoint Census shapefile products in this package, see the 'shapefile_details' tibble for details. Please note, this package is explicitly designed to fit all shapefiles within one CRAN-hosted package. You will want to use the 'tigris' package for programmatic access to the US Census' shapefile products.


Travis-CI Build Status

statesRcontiguous provides a tiny (small enough for CRAN) package containing the following shapefiles for the United States of America:

All shapefiles include a column called contiguous.united.states which allows the dataset to be restricted to the contiguous US very simply:

library(statesRcontiguous)
library(leaflet)
shp_contiguous_states <- shp_all_us_states %>%
  filter(contiguous.united.states)
leaflet(shp_contiguous_states) %>%
  addTiles() %>%
  addPolygons()

Installation

This package is currently only available Github, and can be installed as follows:

devtools::install_github("martinjhnhadley/statesRcontiguous")

Should I use this package?

This package provides only the three shapefiles (states, congressional districts, counties) included in the package. It is intended for where you have a reproducible need for shapefiles for the (contiguous) US and don't want to have to download the files on the fly.

You might prefer to use the tigris package which is available on CRAN, and provides tools to download any of the shapefiles from TIGER.

So why does this exist?

This package was designed for the University of Oxford's Interactive Data Network which exists to provide a visualisation service for academics at Oxford, using Shiny. The Shiny apps developed by researchers are not allowed to contain data files, instead data must be loaded from external DOI-issuing repositories like Figshare.

By providing a small utility package with these shapefiles in, researchers can easily create choropleth of the US.

Data Source

The actual shapefiles (borders) included in this package are from the US Census website, do note that they'd been augmented with additional data from other sources which are detailed in the following table

shapefile_details
#>                             description  year
#>                                   <chr> <int>
#> 1 Details about congressional districts  2016
#> 2                Details about counties  2016
#> 3                  Details about states  2016
#> 4 Shapefile for congressional districts  2016
#> 5                Shapefile for counties  2016
#> 6                  Shapefile for states  2016
#> # ... with 1 more variables: url <chr>

License

This package includes shapefiles from the US Census Bureau. All shapefiles provided by the US Census Bureau are TIGER/Line shapefiles and are offered to the public free of charge, see TIGER/Line Shapefil Technical Documentation for details.

This package itself is made available under the MIT license.

News

tilegramsR 0.1.0

New Features

  • Initial version
  • Shapefiles from 2016, the 115 Congress of the United States

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("statesRcontiguous")

0.1.0 by Martin Hadley, 10 months ago


https://github.com/martinjhnhadley/statesRcontiguous


Report a bug at https://github.com/martinjhnhadley/statesRcontiguous/issues


Browse source code at https://github.com/cran/statesRcontiguous


Authors: person("Martin", "Hadley", email = "[email protected]", role = c("aut", "cre"))


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports magrittr, dplyr

Depends on sf

Suggests knitr, rmarkdown, tidyverse, leaflet, covr


See at CRAN