Skip to content

Commit

Permalink
Addressing CRAN human review.
Browse files Browse the repository at this point in the history
  • Loading branch information
blackerby committed Feb 19, 2024
1 parent 86e4f96 commit ebb852a
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Title: A 'GovInfo' API Wrapper
Version: 0.0.2
Authors@R:
person("William", "Blackerby", , "wmblackerby@gmail.com", role = c("aut", "cre", "cph"))
Description: Access data provided by the United States Government Publishing Office (GPO) 'GovInfo' API.
Description: Access data provided by the United States Government Publishing Office (GPO) 'GovInfo' API (<https://github.com/usgpo/api>).
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
3 changes: 1 addition & 2 deletions R/collections.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_collections(collection = "BILLS", start_date = yesterday())
#' gpo_collections(collection = "BILLS", start_date = "2024-02-17T00:00:00Z")
#' gpo_collections()
#'
gpo_collections <-
Expand Down
4 changes: 2 additions & 2 deletions R/govinfo_key.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Check or Get GovInfo API Key
#'
#' Adapted, with gratitude, from Christopher Kenny's
#' [congress](https://github.com/christopherkenny/congress/blob/201e3a5ae3b28772ff409f9fa36a04c5efa749ce/R/congress_key.R)
#' [congress](https://github.com/christopherkenny/congress/blob/main/R/congress_key.R)
#' package
#'
#' @return logical if `has`, key if `get`
Expand Down Expand Up @@ -63,7 +63,7 @@ set_govinfo_key <-
if (any(exists)) {
if (sum(exists) > 1) {
cli::cli_abort(
"Multiple entries in .Renviron found.\nEdit manually with {.fn usethis::edit_r_environ."
"Multiple entries in .Renviron found.\nEdit manually with {.fn usethis::edit_r_environ}."
)
}

Expand Down
3 changes: 0 additions & 3 deletions R/packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_package_summary("CREC-2018-01-04")
#'
gpo_package_summary <- function(package_id) {
Expand Down Expand Up @@ -49,7 +48,6 @@ gpo_package_summary <- function(package_id) {
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_package_granules("CREC-2018-01-04")
#'
gpo_package_granules <-
Expand Down Expand Up @@ -107,7 +105,6 @@ gpo_package_granules <-
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_package_granules_summary("CREC-2018-01-04", "CREC-2018-01-04-pt1-PgD7-2")
#'
gpo_package_granules_summary <- function(package_id, granule_id) {
Expand Down
1 change: 0 additions & 1 deletion R/published.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_published(
#' start_date = "2024-01-01",
#' end_date = "2024-01-03",
Expand Down
1 change: 0 additions & 1 deletion R/related.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#'
#' @examplesIf govinfoR::has_govinfo_key()
#'
#' set_govinfo_key(get_govinfo_key())
#' gpo_related("BILLS-116hr748enr")
#' gpo_related("BILLS-116hr748enr", collection = "BILLS")
#'
Expand Down
4 changes: 1 addition & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ This first example loads the package, sets the API key (gotten from the environm
```{r example_1}
library(govinfoR)
set_govinfo_key(get_govinfo_key())
gpo_collections()
```

Expand All @@ -52,7 +50,7 @@ The following example demonstrates getting all records in the `BILLS` collection
> The package provides three simple helpers to make it easier to specify dates as arguments to functions (`yesterday()`, `today()`, and `tomorrow()`)
```{r example_2}
gpo_collections(collection = "BILLS", start_date = yesterday())
gpo_collections(collection = "BILLS", start_date = "2024-02-17T00:00:00Z")
```

Examples of the use of other package functions are in the documentation.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ environment), and gets metadata about all 39 GovInfo collections.
``` r
library(govinfoR)

set_govinfo_key(get_govinfo_key())

gpo_collections()
#> # A tibble: 39 × 4
#> collection_code collection_name package_count granule_count
Expand All @@ -65,8 +63,8 @@ collection since midnight yesterday.
> `tomorrow()`)
``` r
gpo_collections(collection = "BILLS", start_date = yesterday())
#> # A tibble: 87 × 7
gpo_collections(collection = "BILLS", start_date = "2024-02-17T00:00:00Z")
#> # A tibble: 29 × 7
#> package_id last_modified package_link doc_class title congress
#> <chr> <dttm> <chr> <fct> <chr> <int>
#> 1 BILLS-118hr7278ih 2024-02-17 05:46:41 https://api… hr Hous… 118
Expand All @@ -79,7 +77,7 @@ gpo_collections(collection = "BILLS", start_date = yesterday())
#> 8 BILLS-118hr7274ih 2024-02-17 05:46:25 https://api… hr Conn… 118
#> 9 BILLS-118hr6544rh 2024-02-17 05:44:35 https://api… hr Atom… 118
#> 10 BILLS-118hres1021ih 2024-02-17 05:44:30 https://api… hres Prov… 118
#> # ℹ 77 more rows
#> # ℹ 19 more rows
#> # ℹ 1 more variable: date_issued <date>
```

Expand Down
8 changes: 8 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This is a re-submission. In this version I have:

* Added a web reference for the API to the `Description` section of the DESCRIPTION file.

* Removed calls to `set_govinfo_key()` from all examples throughout the package, so as not to write to the user's home filespace.

## Resubmission

This is a re-submission. In this version I have:

* Addressed the potentially misspelled words in the DESCRIPTION file.

* Addressed the URLs that failed the URL check.
Expand Down
3 changes: 1 addition & 2 deletions man/gpo_collections.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/gpo_package_granules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/gpo_package_granules_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/gpo_package_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/gpo_published.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/gpo_related.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/key.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ebb852a

Please sign in to comment.