Internal configuration helpers used to retrieve package configuration values from options or environment variables.
Configuration is resolved in the following order:
getOption("redcapsync.config.option.name")Sys.getenv("REDCAPSYNC_CONFIG_OPTION_NAME")# skipped for functionsDefault if unable to find and validate from above.
Details
allow.test.names
Logical for setup_project() allowing project_name starting with TEST_.
Default is FALSE.
# check current value package is using...
config$allow.test.names()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.allow.test.names") # get
options(redcapsync.config.allow.test.names = FALSE) # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_ALLOW_TEST_NAMES") # get
Sys.setenv(REDCAPSYNC_CONFIG_ALLOW_TEST_NAMES = FALSE) # or set in .Renvironshow.api.messages
Logical for showing display API messages from REDCapR and redcapAPI.
Default is FALSE.
# check current value package is using...
config$show.api.messages()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.show.api.messages") # get
options(redcapsync.config.show.api.messages = FALSE) # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_SHOW_API_MESSAGES") # get
Sys.setenv(REDCAPSYNC_CONFIG_SHOW_API_MESSAGES = FALSE) # or set in .Renvironverbose
Logical for showing display API messages from REDCapR and redcapAPI.
Default is FALSE.
# check current value package is using...
config$verbose()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.verbose") # get
options(redcapsync.config.verbose = FALSE) # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_VERBOSE") # get
Sys.setenv(REDCAPSYNC_CONFIG_VERBOSE = FALSE) # or set in .Renvironoffline
Logical for offline, which if TRUE will block any API calls.
Default is FALSE.
# check current value package is using...
config$offline()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.offline") # get
options(redcapsync.config.offline = FALSE) # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_OFFLINE") # get
Sys.setenv(REDCAPSYNC_CONFIG_OFFLINE = FALSE) # or set in .Renvironcache.dir
Character file path overriding the default cache directory. Default follow system standards via rappdir, hoardr, or R_USER_CACHE_DIR
# check current value package is using...
config$cache.dir()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.cache.dir") # get
options(redcapsync.config.cache.dir = "file/path/to/keep/cache") # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_CACHE_DIR") # get
Sys.setenv(REDCAPSYNC_CONFIG_CACHE_DIR = "file/path/to/keep/cache") # setkeyring
Character keyring name (parameter from keyring
package). Default is NULL, which is at the system level. For locking use a
keyring like "REDCapSync"
# check current value package is using...
config$keyring()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.keyring") # get
options(redcapsync.config.keyring = "REDCapSync") # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_KEYRING") # get
Sys.setenv(REDCAPSYNC_CONFIG_KEYRING = "REDCapSync") # set in sessionkeyring.service
Character keyring service name (parameter from keyring
package). Default is "R-REDCapSync".
# check current value package is using...
config$keyring.service()
# set with options (which will be prioritized over envvar)
getOption("redcapsync.config.keyring.service") # get
options(redcapsync.config.keyring.service = "REDCapSync") # set
# set with ennvar (which will be prioritized when options not defined)
Sys.getenv("REDCAPSYNC_CONFIG_KEYRING_SERVICE") # get
Sys.setenv(REDCAPSYNC_CONFIG_KEYRING_SERVICE = "REDCapSync") # set in sessionopenxlsx.header.style
Excel sheet header using openxlsx::createStyle()
openxlsx.body.style
Excel sheet body using openxlsx::createStyle()
Option Names (searched first)
option_list <- list(
redcapsync.config.allow.test.names = NULL,
redcapsync.config.show.api.messages = NULL,
redcapsync.config.verbose = NULL,
redcapsync.config.offline = NULL,
redcapsync.config.cache.dir = NULL,
redcapsync.config.keyring = NULL,
redcapsync.config.keyring.service = NULL,
redcapsync.config.openxlsx.header.style = NULL,
redcapsync.config.openxlsx.body.style = NULL
)Environment Variable Names (searched second)
envvar_list <- list(
REDCAPSYNC_CONFIG_ALLOW_TEST_NAMES = NA,
REDCAPSYNC_CONFIG_SHOW_API_MESSAGES = NA,
REDCAPSYNC_CONFIG_VERBOSE = NA,
REDCAPSYNC_CONFIG_OFFLINE = NA,
R_USER_CACHE_DIR = NA, # affects your entire cache for any package
REDCAPSYNC_CONFIG_CACHE_DIR = NA, # affects only REDCapSync Cache
REDCAPSYNC_CONFIG_KEYRING = NA,
REDCAPSYNC_CONFIG_KEYRING_SERVICE = NA
)