api.key.install: Installs an API key from the US Census to use with calls to...

Description Usage Arguments Details Value Author(s) References See Also

Description

The acs.fetch function requires an "API key" to use when downloading data from the US Census API. Rather than pass this rather long string to the function each time, users can save the key as part of the package installation, using the api.key.install function. Once installed, an api key is saved on the system and available for use in future sessions. (To replace a key, simply call the function again with the new key.)

Usage

1
api.key.install(key, file = "key.rda")

Arguments

key

The API key provided to the user upon registering with the US Census Developer's page. A string.

file

An alternate name to use when storing key; reserved for future use.

Details

The requirement for a key seems to be laxly enforced by the Census API, but is nonetheless coded into the acs package. Users without a key may find success by simply installing a blank key (i.e., key="") via api.key.install(key=""); similarly, calls to acs.fetch and geo.make(..., check=T) may succeed with a key="" argument. Note that while this may work today, it may fail in the future if the API decides to start enforcing the requirement.

Value

Saves the key and exits silently, unless an error is encountered.

Author(s)

Ezra Haber Glenn eglenn@mit.edu

References

To request an API key, see http://www.census.gov/developers/

See Also

acs.fetch


acs documentation built on May 1, 2019, 8:41 p.m.