Option naming conventions use sensible defaults so that you can get started quickly with minimal configuration.
Usage
set_envvar_name_fn(fn, env = parent.frame())
set_option_name_fn(fn, env = parent.frame())
Functions
set_envvar_name_fn()
: Set a callback function to use to format environment variable names.set_option_name_fn()
: Set a callback function to use to format option names.
Defaults
Given a package mypackage
and option myoption
, the default settings
will generate options and environment variables using the convention:
option:
environment variable:
This convention is intended to track closely with how options and environment
variables are handled frequently in the wild. Perhaps in contrast to the
community conventions, an R_
prefix is tacked on to the default environment
variables. This prefix helps to differentiate environment variables when
similarly named tools exist outside of the R ecosystem.
Setting Alternative Conventions
If you choose to use alternative naming conventions, you must set the callback function before defining options. This is best achieved by altering these settings in the file where you define your options.
If you choose to break up your options across multiple files, then it is best to define the collate order for your R scripts to ensure that the options are consistently configured across operating systems.