Skip to content

Commit

Permalink
build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hrecht committed Apr 1, 2024
1 parent 25c8af9 commit 1515ab8
Show file tree
Hide file tree
Showing 10 changed files with 645 additions and 86 deletions.
19 changes: 19 additions & 0 deletions R/api-key.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' Retrieve a Census API key stored the .Renivron file
#'
#' @returns A CENSUS_KEY or CENSUS_API_KEY value stored in the user's .Renviron.
#' file.
#' @export
get_api_key <- function() {
if (Sys.getenv("CENSUS_KEY") != "") {
key <- Sys.getenv("CENSUS_KEY")
key
} else if (Sys.getenv("CENSUS_API_KEY") != "") {
key <- Sys.getenv("CENSUS_API_KEY")
key
} else {
rlang::warn("You do not have a stored Census API key. Using a key is recommended but not required.\nThe Census Bureau may limit your daily requests.\nRegister for an API key at https://api.census.gov/data/key_signup.html\nand store it in your Renviron file as CENSUS_KEY or CENSUS_API_KEY.\nLearn more at https://www.hrecht.com/censusapi/articles/getting-started.html.",
.frequency = "once", .frequency_id = "api_key")
key <- NULL
key
}
}
152 changes: 76 additions & 76 deletions docs/articles/example-list.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-01T14:24Z
last_built: 2024-04-01T14:56Z
urls:
reference: https://www.hrecht.com/censusapi/reference
article: https://www.hrecht.com/censusapi/articles
Expand Down
Loading

0 comments on commit 1515ab8

Please sign in to comment.