View source: R/import-standalone-settoken.R
set_r_environ_token | R Documentation |
.Renviron
fileSet or get a token from your .Renviron
file
set_r_environ_token(
token,
install = FALSE,
overwrite = FALSE,
default = "TOKEN",
quiet = FALSE,
call = caller_env()
)
get_r_environ_token(
token = NULL,
default = "TOKEN",
message = NULL,
pattern = NULL,
perl = TRUE,
strict = TRUE,
call = caller_env(),
...
)
token |
A personal access token, API key, or other environment variable.
Optional for |
install |
If |
overwrite |
If |
default |
Default name used for environment variable where the token is saved. |
quiet |
If |
call |
The execution environment of a currently
running function, e.g. |
message |
Optional error message to use if token can't be found. |
pattern |
Optional pattern passed to |
perl |
Should Perl-compatible regexps be used when checking |
strict |
If |
set_r_environ_token()
invisibly returns a string supplied to
token
.
get_r_environ_token()
returns a string supplied to token
or
obtained from the environment variable named with default
.
Kyle Walker kyle@walker-data.com
Eli Pousson eli.pousson@gmail.com (ORCID)
set_r_environ_token()
can set an API key or personal access token (PAT) as
a local environment variable temporarily for the current session or saved for
future sessions.
get_r_environ_token()
can return an environment variable or error if the
token is missing or if the token does not match a supplied pattern.
Adapted from the tidycensus
function tidycensus::census_api_key()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.