Skip to contents

The clairvoyant::opts object contains three functions to set, get, and reset options used by the clairvoyant package. Use clairvoyant::opts$set to set options, clairvoyant::opts$get to get options, or clairvoyant::opts$reset to reset specific or all options to their default values.

Usage

opts

Format

An object of class list of length 4.

Details

It is normally not necessary to get or set clairvoyant options.

The following arguments can be passed:

...

For clairvoyant::opts$set, the dots can be used to specify the options to set, in the format option = value, for example, silent = TRUE. For clairvoyant::opts$reset, a list of options to be reset can be passed.

option

For clairvoyant::opts$set, the name of the option to set.

default

For clairvoyant::opts$get, the default value to return if the option has not been manually specified.

Some of the options that can be set (see clairvoyant::opts$defaults for the full list):

silent

Whether to be silent or chatty.

Examples

### Get the default setting for silent
clairvoyant::opts$get(silent);
#> [1] TRUE

### Set silent to FALSE
clairvoyant::opts$set(silent = FALSE);

### Check that it worked
clairvoyant::opts$get(silent);
#> [1] FALSE

### Reset this option to its default value
clairvoyant::opts$reset(silent);

### Check that the reset worked, too
clairvoyant::opts$get(silent);
#> [1] TRUE