Persist settings on local configuration file
raveio_setopt(key, value, .save = TRUE)raveio_resetopt(all = FALSE)
raveio_getopt(key, default = NA, temp = TRUE)
raveio_confpath(cfile = "settings.yaml")
raveio_setopt returns modified value;
raveio_resetopt returns current settings as a list;
raveio_confpath returns absolute path for the settings file;
raveio_getopt returns the settings value to the given key, or
default if not found.
character, option name
character or logical of length 1, option value
whether to save to local drive, internally used to temporary change option. Not recommended to use it directly.
whether to reset all non-default keys
is key not found, return default value
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.
file name in configuration path
The following options will alter other packages and might cause changes in behaviors:
'disable_fork_clusters'This option will change the
options 'dipsaus.no.fork' and
'dipsaus.cluster.backup', which handles the parallel computing
'threeBrain_template_subject'This option will set and persist
option 'threeBrain.template_subject', which changes the default
group-level template brain.
raveio_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.
The following keys are reserved by 'RAVE':
data_dirDirectory path, where processed data are stored;
default is at home directory, folder ~/rave_data/data_dir
raw_data_dirDirectory path, where raw data files are stored,
mainly the original signal files and imaging files;
default is at home directory, folder ~/rave_data/raw_dir
max_workerMaximum number of CPU cores to use; default is one less than the total number of CPU cores
mni_template_rootDirectory path, where 'MNI' templates are stored
raveio_getopt returns value corresponding to the keys. If key is
missing, the whole option will be returned.
If set all=TRUE, raveio_resetopt resets all keys including
non-standard ones. However "session_string" will never reset.
R_user_dir
# get one RAVE option
ncore <- raveio_getopt("max_worker")
print(ncore)
# get all options
raveio_getopt()
# set option
raveio_setopt("disable_fork_clusters", FALSE)
Run the code above in your browser using DataLab