MyNixOS website logo
Description

Mapping Data for 'usmap' Package.

Provides a container for data used by the 'usmap' package. The data used by 'usmap' has been extracted into this package so that the file size of the 'usmap' package can be reduced greatly. The data in this package will be updated roughly once per year as new map data files are provided by the US Census Bureau.

đź—ş usmapdata

CRAN check codecov

You might be looking for the usmap package: CRAN | GitHub | Website

Purpose

usmapdata is a container package for the map data frame used in the usmap package. This data has been extracted to keep usmap small and easier to maintain, while allowing the ability to keep the US map data frame updated as often as possible (independently of usmap updates).

This package and repository will only contain functions and data relevant to the actual map and FIPS data used to draw the map in the usmap package. All other functions, including FIPS and mapping convenience functions, will be contained in the usmaprepository.

Map Data

The map data files that we use to plot the maps in R are located in the inst/extdata folder. They are generated from shapefiles published by the US Census Bureau. Data files for maps and FIPS codes at both the state and county levels are included.

The Cartographic Boundary Files are used for mapping in usmap—specifically the 1:20m scale files. This low resolution allows for small file sizes while still allowing enough detail for simple choropleths. The file description can be read here.

Shapefiles are updated yearly by the US Census Bureau. This repository contains scripts which periodically check for new shapefiles and update the data in the package accordingly. For more details see the data-raw directory.

Installation

This package should only be installed if you intend to manipulate the US mapping data frame, which contains coordinates to draw the US state and county boundaries. If you're interested in plotting data on a US map, use the usmap package.

📦 To install from CRAN (recommended), run the following code in an R console:

install.packages("usmapdata")

Developer Build

⚠️ The developer build may be unstable and not function correctly, use with caution.

To install the package from this repository, run the following code in an R console:

# install.package("devtools")
devtools::install_github("pdil/usmapdata")

This method will provide the most recent developer build of usmapdata.

Usage

To begin using usmapdata, import the package using the library command:

library(usmapdata)

Additional Information

Coordinate System

usmap uses the US National Atlas Equal Area coordinate system:

sf::st_crs(9311)
```r
#> Coordinate Reference System:
#>   User input: EPSG:9311
#>   wkt:
#> PROJCRS["NAD27 / US National Atlas Equal Area",
#>     BASEGEOGCRS["NAD27",
#>         DATUM["North American Datum 1927",
#>             ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4267]],
#>     CONVERSION["US National Atlas Equal Area",
#>         METHOD["Lambert Azimuthal Equal Area (Spherical)",
#>             ID["EPSG",1027]],
#>         PARAMETER["Latitude of natural origin",45,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",-100,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["False easting",0,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",0,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]]],
#>     CS[Cartesian,2],
#>         AXIS["easting (X)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1]],
#>         AXIS["northing (Y)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1]],
#>     USAGE[
#>         SCOPE["Statistical analysis."],
#>         AREA["United States (USA) - onshore and offshore."],
#>         BBOX[15.56,167.65,74.71,-65.69]],
#>     ID["EPSG",9311]]
```

This coordinate reference system (CRS) can also be obtained with usmap::usmap_crs().

Acknowledgments

The code used to generate the map files was based on this blog post by Bob Rudis: Moving The Earth (well, Alaska & Hawaii) With R.

Metadata

Version

0.3.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows