Skip to content

Commit 7ad26ec

Browse files
robe2037dtburk
andauthored
Clarify set_ipums_api_key() usage (#96)
* Clarify `set_ipums_api_key()` usage (resolves #95) * Revert the default value of save argument to `overwrite` in set_ipums_api_key, and add two more examples; potentially resolves #95 --------- Co-authored-by: Derek Burk <burkx031@umn.edu>
1 parent de82bbe commit 7ad26ec

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

R/api_helpers.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ ipums_data_collections <- function() {
7575
#' @seealso
7676
#' [set_ipums_default_collection()] to set a default collection.
7777
#'
78+
#' @examples
79+
#' # Set for single session
80+
#' set_ipums_api_key("your-api-key-here")
81+
#'
82+
#' \dontrun{
83+
#' # Save key to .Renviron for future sessions
84+
#' set_ipums_api_key("your-api-key-here", save = TRUE)
85+
#'
86+
#' # Overwrite existing key in .Renviron
87+
#' set_ipums_api_key("your-api-key-here", overwrite = TRUE)
88+
#'
89+
#' # Remove existing key from .Renviron
90+
#' set_ipums_api_key("your-api-key-here", unset = TRUE)
91+
#' }
7892
#' @export
7993
set_ipums_api_key <- function(api_key,
8094
save = overwrite,

man/set_ipums_api_key.Rd

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)