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

opts

Format

An object of class list of length 4.

Details

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

The following arguments can be passed:

...

For metabefor::opts$set, the dots can be used to specify the options to set, in the format option = value, for example, utteranceMarker = "\n". For metabefor::opts$reset, a list of options to be reset can be passed.

option

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

default

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

The following options can be set:

quridPrefix

The prefix for quasi-unique record identifiers (QURIDs).

ws

The worksheet names: a named list with four character values named entities, valueTemplates, definitions, and instructions.

eC

The entity columns; a named list with character values holding the names of the columns in the entities worksheet of the spreadsheet. The default values are stored in metabefor::opts$get("entityColNames") - if you need to override these values, just reproduce that object.

valueTemplateCols

The value template columns; a named list with character values holding the names of the columns in the entities worksheet of the spreadsheet. The default values are stored in metabefor::opts$get("valueTemplateColNames") - if you need to override these values, just reproduce that object.

instructionsCols

The instructions worksheet columns: a names list with character values holding the names of the columns in the instructions worksheet of the spreadsheet. The default values are stored in metabefor::opts$get("instructionsColNames") - if you need to override these values, just reproduce that object.

definitionsCols

The definitions worksheet columns: a names list with character values holding the names of the columns in the definitions worksheet of the spreadsheet. The default values are stored in metabefor::opts$get("definitionsColNames") - if you need to override these values, just reproduce that object.

indentDefault

Whether to use indentation to visually organise the Rxs template. If TRUE, deeper nesting in the Rxs specification's hierarchy will be visible as deeper indentation.

indentSpaces

The number of spaces to use when identing.

fullWidth

The maximum width of the Rxs template in characters.

commentCharacter

The character used to signify comments - if this is changed, R will throw errors (unless perhaps it once introduces another comment symbol).

fillerCharacter

The character used after the first character for filling up space.

repeatingSuffix

The suffix to use for the entity identifiers/names of repeating entities.

Examples

### Get the default Quasi-Unique Record Identifier prefix
metabefor::opts$get(quridPrefix);
#> [1] "qurid_"

### Set it to a custom version, so that every line starts with a pipe
metabefor::opts$set(quridPrefix = "QURID_");

### Check that it worked
metabefor::opts$get(quridPrefix);
#> [1] "QURID_"

### Reset this option to its default value
metabefor::opts$reset(quridPrefix);

### Check that the reset worked, too
metabefor::opts$get(quridPrefix);
#> [1] "qurid_"