restbatch-option: Set/Get 'restbatch' option

Description Usage Arguments Details Value See Also

Description

Persist settings on local configuration file

Usage

1
2
3
4
5
6
7
restbatch_setopt(key, value, .save = TRUE)

restbatch_resetopt(all = FALSE)

restbatch_getopt(key, default = NA, temp = TRUE)

restbatch_confpath(cfile = "settings.yaml")

Arguments

key

character, option name

value

character or logical of length 1, option value

.save

whether to save to local drive, internally used to temporary change option. Not recommended to use it directly.

all

whether to reset all non-default keys

default

is key not found, return default value

temp

when saving, whether the key-value pair should be considered temporary, a temporary settings will be ignored when saving; when getting options, setting temp to false will reveal the actual settings.

cfile

file name in configuration path

Details

restbatch_setopt stores key-value pair in local path. The values are persistent and shared across multiple sessions. There are some read-only keys such as "session_string". Trying to set those keys will result in error.

restbatch_getopt returns value corresponding to the keys. If key is missing, the whole option will be returned.

If set all=TRUE, restbatch_resetopt resets all keys including non-standard ones. However "session_string" will never reset.

Value

restbatch_setopt returns modified value; restbatch_resetopt returns current settings as a list; restbatch_confpath returns absolute path for the settings file; restbatch_getopt returns the settings value to the given key, or default if not found.

See Also

R_user_dir


dipterix/restbatch documentation built on Oct. 13, 2021, 8:58 a.m.