Skip to content

Commit 11fe8cb

Browse files
committed
Merge branch 'master' of github.com:pdil/usmapdata
2 parents eabfdb5 + df45d5c commit 11fe8cb

96 files changed

Lines changed: 2306 additions & 18 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# lintr provides static code analysis for R.
2-
# It checks for adherence to a given style,
3-
# identifying syntax errors and possible semantic issues,
4-
# then reports them to you so you can take action.
52
# More details at https://lintr.r-lib.org/
63

74
name: lint
@@ -34,7 +31,7 @@ jobs:
3431
extra-packages: lintr
3532

3633
- name: Run lintr
37-
run: lintr::sarif_output(lintr::lint_dir("."), "lintr-results.sarif")
34+
run: lintr::sarif_output(lintr::lint_package(), "lintr-results.sarif")
3835
shell: Rscript {0}
3936
continue-on-error: true
4037

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: usmapdata
22
Title: Mapping Data for 'usmap' Package
3-
Version: 0.6.0.9000
3+
Version: 1.0.0.9000
44
Description: Provides a container for data used by the 'usmap' package.
55
The data used by 'usmap' has been extracted into this package so that the
66
file size of the 'usmap' package can be reduced greatly. The data in this

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# [unreleased]
22

3+
# usmapdata 1.0.0
4+
Released Friday, August 22, 2025.
5+
36
### New Features
47
* Puerto Rico has been added!
58
* Finally, after years of procrastinating, Puerto Rico has finally been added to the map, see [Issue #48](https://github.com/pdil/usmapdata/issues/48).

R/usmapdata-package.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#'
33
#' @description
44
#' It is usually difficult or inconvenient to create US maps that
5-
#' include both Alaska and Hawaii in a convenient spot. All map
5+
#' include Alaska, Hawaii, and even Puerto Rico in a convenient spot. All map
66
#' data frames produced by this package use the US National Atlas Equal Area
77
#' projection.
88
#'
99
#' @section Map data frames:
10-
#' Alaska and Hawaii have been manually moved to a new location so that
10+
#' Alaska, Hawaii, and Puerto Rico have been manually moved to a new location so that
1111
#' their new coordinates place them to the bottom-left corner of
1212
#' the map. These maps can be accessed by using the \link{us_map} function.
1313
#'
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Package: usmapdata
2+
Title: Mapping Data for 'usmap' Package
3+
Version: 0.6.0.9000
4+
Description: Provides a container for data used by the 'usmap' package.
5+
The data used by 'usmap' has been extracted into this package so that the
6+
file size of the 'usmap' package can be reduced greatly. The data in this
7+
package will be updated roughly once per year as new map data files are
8+
provided by the US Census Bureau.
9+
Authors@R: person("Paolo", "Di Lorenzo", email = "paolo@dilorenzo.org", role = c("aut", "cre"))
10+
Depends: R (>= 3.5.0)
11+
License: GPL (>= 3)
12+
Encoding: UTF-8
13+
Language: en-US
14+
URL: https://usmap.dev
15+
BugReports: https://github.com/pdil/usmapdata/issues
16+
Imports: rlang, sf
17+
Suggests: covr, dplyr, spelling, testthat (>= 3.0.0), withr
18+
Roxygen: list(markdown = TRUE)
19+
RoxygenNote: 7.3.2
20+
Config/testthat/edition: 3
21+
NeedsCompilation: no
22+
Packaged: 2025-08-21 03:25:18 UTC; runner
23+
Author: Paolo Di Lorenzo [aut, cre]
24+
Maintainer: Paolo Di Lorenzo <paolo@dilorenzo.org>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(available_map_years)
4+
export(centroid_labels)
5+
export(fips_data)
6+
export(us_map)
7+
importFrom(rlang,.data)
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# [unreleased]
2+
3+
### New Features
4+
* Puerto Rico has been added!
5+
* Finally, after years of procrastinating, Puerto Rico has finally been added to the map, see [Issue #48](https://github.com/pdil/usmapdata/issues/48).
6+
* 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.
7+
* `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.).
8+
* Special thanks [@dcaud](https://github.com/dcaud) who started this work [years ago](https://github.com/pdil/usmap/pull/34).
9+
10+
### Enhancements
11+
* `include` now takes precedence over `exclude` in `us_map()`.
12+
* Any items that are in both the `include` and `exclude` vectors will be _included_.
13+
14+
### Removed
15+
* The `as_sf` parameter has been completely removed from `us_map()`, `centroid_labels()`, and `fips_data()`.
16+
* It was no longer used by `usmap` nor did it have any effect if set.
17+
* Any existing code that sets it can safely delete it from `usmapdata` function calls.
18+
19+
# usmapdata 0.6.0
20+
Released Saturday, June 14, 2025.
21+
22+
* Change output of `us_map()` and `centroid_labels()` to data frame instead of tibble.
23+
* If `tibble` format is required use `tibble::as_tibble()` on the output.
24+
25+
# usmapdata 0.5.0
26+
Released Thursday, May 22, 2025.
27+
28+
* Add [2024 shape files](https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.2024.html#list-tab-1883739534).
29+
30+
# usmapdata 0.4.0
31+
Released Thursday, March 6, 2025.
32+
33+
### New Features
34+
* Add `data_year` parameter to `us_map()`, see [Issue #34](https://github.com/pdil/usmapdata/issues/34).
35+
* Allows user to select the year for which to plot US map.
36+
* This will allow the user to match the map that is provided to the data they are using.
37+
* To start with, 2021, 2022, and 2023 maps are included.
38+
* Going forward, each year will be added to the package and previous years can be accessed with this parameter.
39+
* If the value provided via `data_year` is not available, the package will select the next year for which data exists.
40+
* For example, if data sets 2022 and 2023 are available and the user calls `us_map(data_year = 2019)`, 2022 will be used.
41+
* A warning is presented when this occurs to alert the user.
42+
* 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/).
43+
* The old Connecticut counties are available in the 2021 data, 2022 and forward use the new planning regions.
44+
45+
### Improvements
46+
* 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.
47+
* `centroid_labels()` now accepts `"state"` and `"county"` as inputs for the `regions` parameter like `us_map()` and `fips_data()`.
48+
* Update package author email.
49+
50+
# usmapdata 0.3.0
51+
Released Friday, May 15, 2024.
52+
53+
* 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).
54+
55+
# usmapdata 0.2.2
56+
Released Friday, March 8, 2024.
57+
58+
### Improvements
59+
* Improve language in `DESCRIPTION` and minor documentation, see [Issue #19](https://github.com/pdil/usmapdata/issues/19).
60+
61+
### Bug Fixes
62+
* `alaska_bbox()` and `hawaii_bbox()` now output correct `sf` type (`sfc_POLYGON`).
63+
64+
# usmapdata 0.2.1
65+
Released Sunday, February 4, 2024.
66+
67+
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.
68+
69+
### Removed
70+
* The `as_sf` parameter is now deprecated and no longer has any effect.
71+
* 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).
72+
* This parameter will be completely removed in a future version but continues to exist for compatibility reasons.
73+
* Legacy `.csv` files containing mapping and FIPS data have been removed, greatly reducing package size.
74+
75+
# usmapdata 0.2.0
76+
Released Friday, January 12, 2024.
77+
78+
### Improvements
79+
* 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).
80+
* Begin process of upgrading map data to use GeoPackage files instead of csv.
81+
* Previously the files were created using now-retired packages `rgdal`, `rgeos`, and `maptools`.
82+
* The new files can be accessed by passing `as_sf = TRUE` to the `us_map()` and `fips_data()` functions.
83+
* Once the upgrade is complete, this parameter will be removed and the new functionality will be the default.
84+
* The new map files are smaller in size while maintaining the same resolution.
85+
* The format of the data also allows for easier manipulation in the future using the `sf` package.
86+
* Add scripts to perform automated map data updates, see [Issue #5](https://github.com/pdil/usmapdata/issues/5).
87+
* The scripts will check for new shapefiles from the US Census Bureau twice a year and automatically update the data.
88+
* The scripts can also be run manually as needed.
89+
* Once data is updated a new `usmapdata` release will be created.
90+
91+
# usmapdata 0.1.2
92+
Released Monday, December 11, 2023.
93+
94+
* Add `fips_data` function to load raw FIPS data from included csv files.
95+
* `fips_data()`, `fips_data("state")`, or `fips_data("states")` load state FIPS codes
96+
* `fips_data("county")` or `fips_data("counties")` load county FIPS codes
97+
98+
# usmapdata 0.1.1
99+
Released Saturday, October 21, 2023.
100+
101+
* Update package author email and website.
102+
103+
# usmapdata 0.1.0
104+
Released Wednesday, February 2, 2022.
105+
106+
* First release
107+
108+
### Main features
109+
110+
* Contains the `us_map` function and associated data extracted from the `usmap` package
111+
* Will allow future removal of data from `usmap` package so file size can be reduced greatly.

0 commit comments

Comments
 (0)