Skip to content

Commit 7bbbbaa

Browse files
authored
Merge pull request #51 from ropensci/v0.5.0
air format, added new maintainer, updated data, vignettes to 2024 except states
2 parents 0f56f49 + 6e15332 commit 7bbbbaa

Some content is hidden

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

59 files changed

+1011
-307
lines changed

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
^Makefile$
1515
^\.github$
1616
^CRAN-RELEASE$
17+
^[.]?air[.]toml$
18+
^codemeta.json$
19+
^doc$
20+
^Meta$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing to USAboundaries
2+
3+
This outlines how to propose a change to USAboundaries.
4+
For a detailed discussion on contributing to this and other tidyverse packages, please see the [development contributing guide](https://rstd.io/tidy-contrib) and our [code review principles](https://code-review.tidyverse.org/).
5+
6+
## Fixing typos
7+
8+
You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file.
9+
This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file.
10+
You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.
11+
12+
## Bigger changes
13+
14+
If you want to make a bigger change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
15+
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
16+
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed).
17+
See our guide on [how to create a great issue](https://code-review.tidyverse.org/issues/) for more advice.
18+
19+
### Pull request process
20+
21+
* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("ropensci/USAboundaries", fork = TRUE)`.
22+
23+
* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`.
24+
If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
25+
* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.
26+
27+
* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
28+
The title of your PR should briefly describe the change.
29+
The body of your PR should contain `Fixes #issue-number`.
30+
31+
* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tidyverse.org/news.html>.
32+
33+
### Code style
34+
35+
* New code should follow the tidyverse [style guide](https://style.tidyverse.org).
36+
You can use [Air](https://posit-dev.github.io/air/) to apply this style, but please don't restyle code that has nothing to do with your PR.
37+
38+
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.
39+
40+
* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
41+
Contributions with test cases included are easier to accept.
42+
43+
## Code of Conduct
44+
45+
Please note that the USAboundaries project is released with a [Contributor
46+
Code of Conduct](https://ropensci.org/code-of-conduct/).
47+
By
48+
contributing to this project, you agree to abide by its terms.

.github/workflows/R-CMD-check.yaml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87

9-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
R-CMD-check:
@@ -18,7 +19,7 @@ jobs:
1819
fail-fast: false
1920
matrix:
2021
config:
21-
- {os: macOS-latest, r: 'release'}
22+
- {os: macos-latest, r: 'release'}
2223
- {os: windows-latest, r: 'release'}
2324
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2425
- {os: ubuntu-latest, r: 'release'}
@@ -29,31 +30,22 @@ jobs:
2930
R_KEEP_PKG_SOURCE: yes
3031

3132
steps:
32-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
3334

34-
- uses: r-lib/actions/setup-pandoc@v1
35+
- uses: r-lib/actions/setup-pandoc@v2
3536

36-
- uses: r-lib/actions/setup-r@v1
37+
- uses: r-lib/actions/setup-r@v2
3738
with:
3839
r-version: ${{ matrix.config.r }}
3940
http-user-agent: ${{ matrix.config.http-user-agent }}
4041
use-public-rspm: true
41-
extra-repositories: https://ropensci.r-universe.dev
4242

43-
- uses: r-lib/actions/setup-r-dependencies@v1
43+
- uses: r-lib/actions/setup-r-dependencies@v2
4444
with:
45-
extra-packages: rcmdcheck
46-
47-
- uses: r-lib/actions/check-r-package@v1
48-
49-
- name: Show testthat output
50-
if: always()
51-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
52-
shell: bash
45+
extra-packages: any::rcmdcheck
46+
needs: check
5347

54-
- name: Upload check results
55-
if: failure()
56-
uses: actions/upload-artifact@main
48+
- uses: r-lib/actions/check-r-package@v2
5749
with:
58-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
59-
path: check
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
2+
3+
on:
4+
# Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
5+
# privileges, otherwise we can't set `pull-requests: write` when the pull
6+
# request comes from a fork, which is our main use case (external contributors).
7+
#
8+
# `pull_request_target` runs in the context of the target branch (`main`, usually),
9+
# rather than in the context of the pull request like `pull_request` does. Due
10+
# to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
11+
# This is typically frowned upon by GitHub, as it exposes you to potentially running
12+
# untrusted code in a context where you have elevated privileges, but they explicitly
13+
# call out the use case of reformatting and committing back / commenting on the PR
14+
# as a situation that should be safe (because we aren't actually running the untrusted
15+
# code, we are just treating it as passive data).
16+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
17+
pull_request_target:
18+
19+
name: format-suggest.yaml
20+
21+
jobs:
22+
format-suggest:
23+
name: format-suggest
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
# Required to push suggestion comments to the PR
28+
pull-requests: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
35+
- name: Install
36+
uses: posit-dev/setup-air@v1
37+
38+
- name: Format
39+
run: air format .
40+
41+
- name: Suggest
42+
uses: reviewdog/action-suggester@v1
43+
with:
44+
level: error
45+
fail_level: error
46+
tool_name: air
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
test-coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::covr, any::xml2
28+
needs: coverage
29+
30+
- name: Test coverage
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
print(cov)
38+
covr::to_cobertura(cov)
39+
shell: Rscript {0}
40+
41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
- name: Show testthat output
51+
if: always()
52+
run: |
53+
## --------------------------------------------------------------------
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
55+
shell: bash
56+
57+
- name: Upload test results
58+
if: failure()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: coverage-test-failures
62+
path: ${{ runner.temp }}/package

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata
5+
inst/doc
6+
/doc/
7+
/Meta/

DESCRIPTION

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
Package: USAboundaries
22
Type: Package
33
Title: Historical and Contemporary Boundaries of the United States of America
4-
Version: 0.4.0
4+
Version: 0.5.0
55
Authors@R: c(person("Lincoln", "Mullen",
66
email = "lincoln@lincolnmullen.com",
7-
role = c("aut", "cre"),
7+
role = c("aut"),
88
comment = c(ORCID = "0000-0001-5103-6917")),
99
person("Jordan", "Bratt",
1010
email = "jfbratt@gmail.com",
1111
role = c("aut"),
1212
comment = c(ORCID = "0000-0001-9051-7203")),
13-
person("United States Census Bureau", role = "cph"))
13+
person("United States Census Bureau", role = "cph"),
14+
person("Jacci", "Ziebert", email = "jacciziebert@gmail.com", role = "cre"))
1415
Description: The boundaries for geographical units in the United States of
1516
America contained in this package include state, county, congressional
1617
district, and zip code tabulation area. Contemporary boundaries are provided
@@ -20,21 +21,26 @@ Description: The boundaries for geographical units in the United States of
2021
provided in the 'USAboundariesData' package; this package provides an
2122
interface to access that data.
2223
License: MIT + file LICENSE
23-
URL: http://lincolnmullen.com/software/usaboundaries/, https://github.com/ropensci/USAboundaries
24+
URL: https://docs.ropensci.org/USAboundaries, https://github.com/ropensci/USAboundaries
2425
BugReports: https://github.com/ropensci/USAboundaries/issues
2526
Depends:
26-
R (>= 3.1.1)
27+
R (>= 3.5)
28+
Imports:
29+
USAboundariesData (>= 0.4.0)
30+
Remotes:
31+
ropensci/USAboundariesData
2732
Suggests:
28-
sf (>= 1.0.0),
29-
testthat (>= 0.9.1),
30-
USAboundariesData (>= 0.4.0),
3133
covr,
34+
dplyr,
3235
knitr,
36+
leaflet,
3337
rmarkdown,
34-
dplyr,
35-
leaflet
36-
RoxygenNote: 7.1.2
37-
Additional_repositories: https://ropensci.r-universe.dev
38+
sf (>= 1.0.0),
39+
testthat (>= 0.9.1),
40+
tibble
41+
RoxygenNote: 7.3.3
42+
Additional_repositories:
43+
https://ropensci.r-universe.dev
3844
LazyData: true
3945
LazyDataCompression: xz
4046
VignetteBuilder: knitr

NEWS.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
# USAboundaries 0.3.1
2-
3-
- New vignette demonstrating the package's functionality (#40).
4-
- Additions and clarifications to documentation following @AndySouth's suggestions for JOSS peer review (#38).
5-
- `us_cities()` now returns an `sf` object rather than a data frame (#36).
6-
- `us_cities()` gains a `states` argument to match other functions in the package (#35).
7-
- Citation to JOSS paper.
1+
# USAboundaries 0.5.0
2+
- Update Census Bureau data from 2020 to 2024.
83

94
# USAboundaries 0.4.0
105

@@ -13,6 +8,14 @@
138
- Remove the `us_boundaries()` function was a needless wrapper around other functions.
149
- Prompt user to install data package rather than installing it for them.
1510

11+
# USAboundaries 0.3.1
12+
13+
- New vignette demonstrating the package's functionality (#40).
14+
- Additions and clarifications to documentation following @AndySouth's suggestions for JOSS peer review (#38).
15+
- `us_cities()` now returns an `sf` object rather than a data frame (#36).
16+
- `us_cities()` gains a `states` argument to match other functions in the package (#35).
17+
- Citation to JOSS paper.
18+
1619
# USAboundaries 0.3.0
1720

1821
- Moved most data to USAboundariesData. This improves loading time and permits more frequent updates to the user-facing package.

R/data-doc.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#' U.S. state boundaries
22
#'
33
#' The U.S. Census Bureau provides
4-
#' \href{https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html}{cartographic
5-
#' boundary files} for current U.S. boundaries. This package has only the
6-
#' low-resolution contemporary state boundaries. Other census boundary files are
7-
#' provided by and documented in the USAboundariesData package.
4+
#' \href{https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html}{cartographic boundary files} for current U.S. boundaries. This package has
5+
#' only the low-resolution contemporary state boundaries. Other census boundary
6+
#' files are provided by and documented in the USAboundariesData package.
87
#' @seealso For citations for the other Census boundary files provided by the
98
#' USAboundariesData package, see the \code{census_boundaries} documentation
109
#' in that package.

0 commit comments

Comments
 (0)