Skip to contents

This function stores a Census API key for use with zi_get_demographics() and zi_aggregate(). It is a thin, zi_-prefixed wrapper around tidycensus::census_api_key() so that package setup can be completed entirely through zippeR's own function namespace.

Usage

zi_census_api_key(key, overwrite = FALSE, install = FALSE)

Arguments

key

A character scalar containing a Census API key, which can be obtained at https://api.census.gov/data/key_signup.html.

overwrite

A logical scalar; if TRUE, overwrite an existing Census API key stored in .Renviron. Default is FALSE.

install

A logical scalar; if TRUE, install the key in .Renviron for use in future sessions. Default is FALSE.

Value

The Census API key, invisibly.

Examples

if (FALSE) { # interactive()
  zi_census_api_key(key = "111111abc", install = TRUE)
}