Description Usage Arguments Examples
Determines if option(ws_incites_key)
or
option(ws_incites_key_filename)
is set.
If not, it stops and returns an error. If so, returns the value.
1 2 3 | ws_incites_key(api_key = NULL, error = TRUE)
ws_have_incites_key(api_key = NULL)
|
api_key |
Web of Science API key |
error |
Should the function error if |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | res = ws_incites_key(error = FALSE)
tfile = tempfile()
writeLines("my_api_key", con = tfile)
options(ws_incites_key_filename = tfile)
ws_incites_key()
file.remove(tfile)
options(ws_incites_key_filename = NULL)
ws_filename = getOption("ws_incites_key_filename")
INCITES_KEY = Sys.getenv("INCITES_KEY")
Sys.setenv(INCITES_KEY = "")
writeLines(c("my_api_key1", "api_key2"), con = tfile)
options(ws_incites_key_filename = tfile)
testthat::expect_warning(ws_incites_key())
file.remove(tfile)
Sys.setenv(INCITES_KEY = INCITES_KEY)
options(ws_incites_key_filename = ws_filename)
ws_have_incites_key()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.