opts {rosetta} | R Documentation |
Options for the rosetta package
Description
The rosetta::opts
object contains three functions to set, get, and reset
options used by the rosetta package. Use rosetta::opts$set
to set options,
rosetta::opts$get
to get options, or rosetta::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 rosetta
options.
The following arguments can be passed:
- ...
For
rosetta::opts$set
, the dots can be used to specify the options to set, in the formatoption = value
, for example,varViewCols = c("values", "level")
. Forrosetta::opts$reset
, a list of options to be reset can be passed.- option
For
rosetta::opts$set
, the name of the option to set.- default
For
rosetta::opts$get
, the default value to return if the option has not been manually specified.
The following options can be set:
- varViewCols
The order and names of the columns to include in the variable view.
- showLabellerWarning
Whether to show a warning if labeller labels are encountered.
Examples
### Get the default columns in the variable view
rosetta::opts$get(varViewCols);
### Set it to a custom version
rosetta::opts$set(varViewCols = c("values", "level"));
### Check that it worked
rosetta::opts$get(varViewCols);
### Reset this option to its default value
rosetta::opts$reset(varViewCols);
### Check that the reset worked, too
rosetta::opts$get(varViewCols);