Determines if option(elsevier_api_key) or option(elsevier_api_key_filename) is set. If not, it stops and returns an error. If so, returns the value.

get_api_key(api_key = NULL, error = TRUE)

have_api_key(api_key = NULL)

Arguments

api_key

Elsevier API key

error

Should the function error if api_key = NULL?

Value

API key

Note

You can either set the API key using option(elsevier_api_key) or have it accessible by api_key = Sys.getenv('Elsevier_API').

Examples

res = get_api_key(error = FALSE)