Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# lintr provides static code analysis for R.
# It checks for adherence to a given style,
# identifying syntax errors and possible semantic issues,
# then reports them to you so you can take action.
# More details at https://lintr.r-lib.org/

name: lint
Expand Down Expand Up @@ -34,7 +31,7 @@ jobs:
extra-packages: lintr

- name: Run lintr
run: lintr::sarif_output(lintr::lint_dir("."), "lintr-results.sarif")
run: lintr::sarif_output(lintr::lint_package(), "lintr-results.sarif")
shell: Rscript {0}
continue-on-error: true

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: usmapdata
Title: Mapping Data for 'usmap' Package
Version: 0.6.0.9000
Version: 1.0.0.9000
Description: 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
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# [unreleased]

# usmapdata 1.0.0
Released Friday, August 22, 2025.

### New Features
* Puerto Rico has been added!
* Finally, after years of procrastinating, Puerto Rico has finally been added to the map, see [Issue #48](https://github.com/pdil/usmapdata/issues/48).
Expand Down
4 changes: 2 additions & 2 deletions R/usmapdata-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#'
#' @description
#' It is usually difficult or inconvenient to create US maps that
#' include both Alaska and Hawaii in a convenient spot. All map
#' include Alaska, Hawaii, and even Puerto Rico in a convenient spot. All map
#' data frames produced by this package use the US National Atlas Equal Area
#' projection.
#'
#' @section Map data frames:
#' Alaska and Hawaii have been manually moved to a new location so that
#' Alaska, Hawaii, and Puerto Rico have been manually moved to a new location so that
#' their new coordinates place them to the bottom-left corner of
#' the map. These maps can be accessed by using the \link{us_map} function.
#'
Expand Down
24 changes: 24 additions & 0 deletions check/usmapdata.Rcheck/00_pkg_src/usmapdata/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Package: usmapdata
Title: Mapping Data for 'usmap' Package
Version: 0.6.0.9000
Description: 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.
Authors@R: person("Paolo", "Di Lorenzo", email = "paolo@dilorenzo.org", role = c("aut", "cre"))
Depends: R (>= 3.5.0)
License: GPL (>= 3)
Encoding: UTF-8
Language: en-US
URL: https://usmap.dev
BugReports: https://github.com/pdil/usmapdata/issues
Imports: rlang, sf
Suggests: covr, dplyr, spelling, testthat (>= 3.0.0), withr
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-08-21 03:25:18 UTC; runner
Author: Paolo Di Lorenzo [aut, cre]
Maintainer: Paolo Di Lorenzo <paolo@dilorenzo.org>
7 changes: 7 additions & 0 deletions check/usmapdata.Rcheck/00_pkg_src/usmapdata/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(available_map_years)
export(centroid_labels)
export(fips_data)
export(us_map)
importFrom(rlang,.data)
111 changes: 111 additions & 0 deletions check/usmapdata.Rcheck/00_pkg_src/usmapdata/NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# [unreleased]

### New Features
* Puerto Rico has been added!
* Finally, after years of procrastinating, Puerto Rico has finally been added to the map, see [Issue #48](https://github.com/pdil/usmapdata/issues/48).
* All included map files have been retroactively updated to include Puerto Rico, so any valid value of `data_year` will include Puerto Rico if desired.
* `us_map()` and `fips_data()` both return Puerto Rico in their data sets and it can be included or excluded just like any state (using FIPS, full name, abbreviation, etc.).
* Special thanks [@dcaud](https://github.com/dcaud) who started this work [years ago](https://github.com/pdil/usmap/pull/34).

### Enhancements
* `include` now takes precedence over `exclude` in `us_map()`.
* Any items that are in both the `include` and `exclude` vectors will be _included_.

### Removed
* The `as_sf` parameter has been completely removed from `us_map()`, `centroid_labels()`, and `fips_data()`.
* It was no longer used by `usmap` nor did it have any effect if set.
* Any existing code that sets it can safely delete it from `usmapdata` function calls.

# usmapdata 0.6.0
Released Saturday, June 14, 2025.

* Change output of `us_map()` and `centroid_labels()` to data frame instead of tibble.
* If `tibble` format is required use `tibble::as_tibble()` on the output.

# usmapdata 0.5.0
Released Thursday, May 22, 2025.

* Add [2024 shape files](https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.2024.html#list-tab-1883739534).

# usmapdata 0.4.0
Released Thursday, March 6, 2025.

### New Features
* Add `data_year` parameter to `us_map()`, see [Issue #34](https://github.com/pdil/usmapdata/issues/34).
* Allows user to select the year for which to plot US map.
* This will allow the user to match the map that is provided to the data they are using.
* To start with, 2021, 2022, and 2023 maps are included.
* Going forward, each year will be added to the package and previous years can be accessed with this parameter.
* If the value provided via `data_year` is not available, the package will select the next year for which data exists.
* For example, if data sets 2022 and 2023 are available and the user calls `us_map(data_year = 2019)`, 2022 will be used.
* A warning is presented when this occurs to alert the user.
* Further reading on the impetus for this change: [major changes made to Connecticut counties in 2023](https://www.ctinsider.com/projects/2023/ct-planning-regions/).
* The old Connecticut counties are available in the 2021 data, 2022 and forward use the new planning regions.

### Improvements
* Improve python script and GitHub Actions workflow that download and process map shapefiles to be more flexible and support new `data_year` feature listed above.
* `centroid_labels()` now accepts `"state"` and `"county"` as inputs for the `regions` parameter like `us_map()` and `fips_data()`.
* Update package author email.

# usmapdata 0.3.0
Released Friday, May 15, 2024.

* Update map data to use [2023 shape files](https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.2023.html#list-tab-1883739534).

# usmapdata 0.2.2
Released Friday, March 8, 2024.

### Improvements
* Improve language in `DESCRIPTION` and minor documentation, see [Issue #19](https://github.com/pdil/usmapdata/issues/19).

### Bug Fixes
* `alaska_bbox()` and `hawaii_bbox()` now output correct `sf` type (`sfc_POLYGON`).

# usmapdata 0.2.1
Released Sunday, February 4, 2024.

This update continues the `sf` migration by setting the `as_sf` parameter to default to the behavior of `TRUE`. This parameter no longer has any effect, as explained below. The next phase will involve updating `usmap` to no longer make use of this parameter, in which case it can be completely removed.

### Removed
* The `as_sf` parameter is now deprecated and no longer has any effect.
* As part of this removal, the default behavior for `us_map()`, `centroid_labels()`, and `fips_data()` is equivalent to `as_sf = TRUE` which is to return their data as an `sf` object (see `0.2.0` release notes for more details).
* This parameter will be completely removed in a future version but continues to exist for compatibility reasons.
* Legacy `.csv` files containing mapping and FIPS data have been removed, greatly reducing package size.

# usmapdata 0.2.0
Released Friday, January 12, 2024.

### Improvements
* Update map data to use [2022 shape files](https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.2022.html#list-tab-1883739534).
* Begin process of upgrading map data to use GeoPackage files instead of csv.
* Previously the files were created using now-retired packages `rgdal`, `rgeos`, and `maptools`.
* The new files can be accessed by passing `as_sf = TRUE` to the `us_map()` and `fips_data()` functions.
* Once the upgrade is complete, this parameter will be removed and the new functionality will be the default.
* The new map files are smaller in size while maintaining the same resolution.
* The format of the data also allows for easier manipulation in the future using the `sf` package.
* Add scripts to perform automated map data updates, see [Issue #5](https://github.com/pdil/usmapdata/issues/5).
* The scripts will check for new shapefiles from the US Census Bureau twice a year and automatically update the data.
* The scripts can also be run manually as needed.
* Once data is updated a new `usmapdata` release will be created.

# usmapdata 0.1.2
Released Monday, December 11, 2023.

* Add `fips_data` function to load raw FIPS data from included csv files.
* `fips_data()`, `fips_data("state")`, or `fips_data("states")` load state FIPS codes
* `fips_data("county")` or `fips_data("counties")` load county FIPS codes

# usmapdata 0.1.1
Released Saturday, October 21, 2023.

* Update package author email and website.

# usmapdata 0.1.0
Released Wednesday, February 2, 2022.

* First release

### Main features

* Contains the `us_map` function and associated data extracted from the `usmap` package
* Will allow future removal of data from `usmap` package so file size can be reduced greatly.
Loading
Loading