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.
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()
This package is currently only available Github, and can be installed as follows:
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.
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.
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>
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.