set_os_key {osdatahub} | R Documentation |
Set credentials for OS Data Hub
Description
In order to use the Ordnance Survey Data Hub a valid API key is required.
Usage
set_os_key(apikey)
get_os_key()
has_os_key()
Arguments
apikey |
(character) Required project API key. |
Details
Stores the user provided character string in an environment variable
named OS_API_KEY
. No validation of the key is applied when storing.
To obtain a key go to https://osdatahub.os.uk/.
Be careful not to reveal secrets including API keys. This function
may print the API key to the console. It is used internally by the
osdatahub
query functions.
Primarily this is used internally to control when examples are executed.
Value
(Invisibly) A logical value from Sys.setenv
whether an
environment variable was set.
If an environment variable named OS_API_KEY
is present, the
character string for the variable is returned.
If an environment variable named OS_API_KEY
is present, then
TRUE
, else this function returns FALSE
.
Examples
set_os_key('my-api-key')
my_api_key <- get_os_key()
has_os_key()