Skip to content

Commit

Permalink
minor doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hrecht committed Apr 2, 2024
1 parent 2709834 commit aff9146
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 96 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
* Increases required version of R from >=3.0 to >=3.5 (released in 2018) based on httr dependency.

## New features
### API keys
* `getCensus()` no longer requires `key`, the use of a Census Bureau API key. Users are still encouraged to register for and use an API key because the Census Bureau may rate limit IP addresses, but it is not required. (#87)

* New `get_api_key()` helper function retrieves the value of a user's stored Census Bureau API key from a saved environment variable or provides a warning message if none is found.


### Metadata
* `listCensusApis()` now has optional `name` and `vintage` parameters to get metadata for a subset of datasets or a single dataset. (#103)

```R
Expand All @@ -19,6 +21,7 @@ apis_timeseries <- listCensusApis(name = "timeseries")

## Minor improvements
* `getCensus()` automatically converts data columns from the Household Pulse Survey (`name = "timeseries/hps"`) to numeric.
* New `has_api_key()` helper function detects if there is a stored Census Bureau API key in the Renviron, intended mainly for internal use.

## Documentation
* Function documentation is improved and better formatted.
Expand Down
3 changes: 2 additions & 1 deletion R/api-key.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ get_api_key <- function() {
key
}
}
#' Is there a saved API token?
#' Is there a saved Census API key in the .Renivron file?
#'
#' @family helpers
#' @returns TRUE or FALSE.
#' @examples
#' has_api_key()
#'
Expand Down
2 changes: 1 addition & 1 deletion R/getcensus_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ getFunction <- function(apiurl, name, key, get, region, regionin, time, show_cal
#' @param region Geography to get.
#' @param regionin Optional hierarchical geography to limit region.
#' @param key A Census API key, obtained at
#' https://api.census.gov/data/key_signup.html. If you have a `CENSUS_KEY` or
#' <https://api.census.gov/data/key_signup.html>. If you have a `CENSUS_KEY` or
#' `CENSUS_API_KEY` stored in your .Renviron file, getCensus() will
#' automatically use that key. Using a key is recommended but not required.
#' @param time Time period of data to get. Required for most timeseries APIs.
Expand Down
160 changes: 80 additions & 80 deletions docs/articles/example-list.html

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

15 changes: 12 additions & 3 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ articles:
frequently-asked-questions: frequently-asked-questions.html
getting-started: getting-started.html
censusapi: censusapi.html
last_built: 2024-04-02T17:51Z
last_built: 2024-04-02T18:10Z
urls:
reference: https://www.hrecht.com/censusapi/reference
article: https://www.hrecht.com/censusapi/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/getCensus.html

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

Loading

0 comments on commit aff9146

Please sign in to comment.