The options environment stores primarily, the default values for options. In addition, it stores metadata pertaining to each option in the form of attributes.
Usage
options_initialized(env, inherits = FALSE)
init_options_env(env = parent.frame())
as_options_list(x, ...)
# S3 method for class 'list'
as_options_list(x, ...)
# S3 method for class 'options_env'
as_options_list(x, ...)
get_option_default_value(x, env = parent.frame())
get_options_spec(env = parent.frame())
get_option_spec(
name,
env = parent.frame(),
inherits = FALSE,
on_missing = warning
)
set_option_spec(name, details, env = parent.frame())
Functions
options_initialized()
: Test whether options is initialized in environmentinit_options_env()
: Initialize an options objectas_options_list()
: Convert into an options listget_option_default_value()
: Get the option's default valueget_options_spec()
: Get all options specifications as named listget_option_spec()
: Get single option specificationset_option_spec()
: Set single option specification
Attributes
spec
: A named list of option specificationsoption_name_fn
: A function used to derive default option names for newly defined options. Seeset_option_name_fn()
.envvar_name_fn
: A function used to derive default environment variable names for newly defined options. Seeset_envvar_name_fn()
.