get_var | R Documentation |
Get a variable from, in order of priority, environment variable, .env or settings.ini, or default values. Data type can be cast to boolean or integer.
get_var(
config = NULL,
var_name = NULL,
path = NULL,
default = structure("UNDEFINED_", class = "UNDEFINED_"),
cast = NULL
)
config |
an object returned by the |
var_name |
the variable of interest |
path |
the path from where config files are searched for. If NULL,the current directory will be considered as default. |
default |
a default value |
cast |
Either a function or a type of cast. Currently implemented options are 'integer', 'boolean' or 'float'. |
The value associated to the config variable. The type depends on the cast argument. Default is string.
config <- get_config()
get_var(config, "test", default = "yes", cast = "bool")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.