From 2998d97e8b79f2cd52e3ba11e08e081921841e85 Mon Sep 17 00:00:00 2001 From: Alexander Rossell Hayes Date: Wed, 15 Nov 2023 11:28:01 -0800 Subject: [PATCH] docs(predict_race): document that `census.key` will be retrieved from `CENSUS_API_KEY` envvar --- R/predict_race.R | 11 ++++++++--- man/predict_race.Rd | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/R/predict_race.R b/R/predict_race.R index 31ed173..10bd067 100644 --- a/R/predict_race.R +++ b/R/predict_race.R @@ -42,9 +42,14 @@ #' must have column named \code{place}. #' Specifying \code{\var{census.geo}} will call \code{census_helper} function #' to merge Census geographic data at specified level of geography. -#' @param census.key A character object specifying user's Census API -#' key. Required if \code{\var{census.geo}} is specified, because -#' a valid Census API key is required to download Census geographic data. +#' +#' @param census.key A character object specifying user's Census API key. +#' Required if `census.geo` is specified, because a valid Census API key is +#' required to download Census geographic data. +#' +#' If [`NULL`], the default, attempts to find a census key stored in an +#' [environment variable][Sys.getenv] named `CENSUS_API_KEY`. +#' #' @param census.data A list indexed by two-letter state abbreviations, #' which contains pre-saved Census geographic data. #' Can be generated using \code{get_census_data} function. diff --git a/man/predict_race.Rd b/man/predict_race.Rd index f753d16..3c73abd 100644 --- a/man/predict_race.Rd +++ b/man/predict_race.Rd @@ -67,9 +67,12 @@ must have column named \code{place}. Specifying \code{\var{census.geo}} will call \code{census_helper} function to merge Census geographic data at specified level of geography.} -\item{census.key}{A character object specifying user's Census API -key. Required if \code{\var{census.geo}} is specified, because -a valid Census API key is required to download Census geographic data.} +\item{census.key}{A character object specifying user's Census API key. +Required if \code{census.geo} is specified, because a valid Census API key is +required to download Census geographic data. + +If \code{\link{NULL}}, the default, attempts to find a census key stored in an +\link[=Sys.getenv]{environment variable} named \code{CENSUS_API_KEY}.} \item{census.data}{A list indexed by two-letter state abbreviations, which contains pre-saved Census geographic data.