blockr_option | R Documentation |
Retrieves options via base::getOption()
or base::Sys.getenv()
, in that
order, and prefixes the option name passed as name
with blockr.
or
blockr_
respectively. Additionally, the name is converted to lower case
for getOption()
and upper case for environment variables. In case no value
is available for a given name
, default
is returned.
blockr_option(name, default)
name |
Option name |
default |
Default value |
The value set as option name
or default
if not set. In case of
the option being available only as environment variable, the value will be
a string and if available as base::options()
entry it may be of any R type.
blockr_option("test-example", "default")
options(`blockr.test-example` = "non-default")
blockr_option("test-example", "default")
Sys.setenv(`BLOCKR_TEST-EXAMPLE` = "another value")
tryCatch(
blockr_option("test-example", "default"),
error = function(e) conditionMessage(e)
)
options(`blockr.test-example` = NULL)
blockr_option("test-example", "default")
Sys.unsetenv("BLOCKR_TEST-EXAMPLE")
blockr_option("test-example", "default")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.