← Back to all sparks
U

usmap

INFRA · APIS
Velocity0.0

US Maps Including Alaska and Hawaii

Ten years in, US mapping splits its data out and finally adds Puerto Rico.

cartographysfdata-packagingfipsterritories
Current state
usmap plots US state and county maps in an Alaska- and Hawaii-inset projection and joins user data to them by FIPS code. Over the last two years it has been rebuilt underneath: the map data moved out to a companion usmapdata package, the geometry became sf, and a data_year parameter lets a plot match the vintage of the data being plotted. Version 1.0.0 marks ten years of the project and adds Puerto Rico across every function.
Where it's heading
The package has separated what it draws from how it draws, and that separation is what makes the recent releases possible: annual map vintages ship in usmapdata without touching usmap, and Puerto Rico could be backfilled into every existing year at once. The remaining work is coverage and defaults rather than architecture, and the Puerto Rico exclusion default is already governed by an environment variable rather than a code change.
Prediction
Expect the annual map vintage to keep arriving through usmapdata, with usmap itself changing only where a new territory or a projection default needs handling.

Recent moves

  1. 11mo ago

    Puerto Rico added across every usmap function and map year

    Puerto Rico becomes a first-class region: included in every function, backfilled into all map years, and shown as municipalities on county maps. It stays out of plot_usmap() by default unless requested or the USMAP_DEFAULT_EXCLUDE_PR environment variable is set. Broader coverage on an architecture that was already built for it.

    View source ↗
  2. 1y ago

    data_year parameter threaded through the plotting functions

    Exposes the data_year parameter across fips(), fips_info(), map_with_data(), plot_usmap() and us_map(), falling forward to the next available year with a warning. This is usmap's side of the vintage work that originated in usmapdata 0.4.0, which it now requires; the motivating case is Connecticut replacing counties with planning regions in 2023.

    View source ↗
  3. 2y ago

    Population and poverty data refreshed; ggplot2 3.5 legend fix

    Refreshes the bundled population and poverty data to 2022 and 2021, picking up Connecticut's corrected FIPS codes, adapts the map theme to ggplot2 3.5.0 legend behaviour, and routes transformations through usmapdata's internal functions so the values used to build maps and to transform user data stay in step.

    View source ↗
  4. 2y ago

    Map data becomes sf; usmap_transform() returns geometry

    ⚡ SPARK

    The release that changed what usmap hands back: us_map() now returns an sf object rather than a data frame, and usmap_transform() replaces lat and lon with a geometry column while accepting sf input directly. The projection stays the same, but everything downstream can now be treated as spatial data.

    View source ↗
  5. 2y ago

    Documentation links updated

    A documentation link refresh released the same day as 0.6.0, with no functional change.

    View source ↗
  6. 2y ago

    Map data extracted to a companion usmapdata package

    ⚡ SPARK

    Alongside new usmap_transform() naming parameters and a higher-resolution map, this release moves the map data frame out to a separate usmapdata package. Presented as a size reduction, it is the split every later release depends on.

    View source ↗