Skip to contents

The get_option() function is a helper for retrieving the value of parabar options. If the option requested is not available in the session base::.Options list, the corresponding default value set by the Options R6::R6 class is returned instead.

The set_option() function is a helper for setting parabar options. The function adjusts the fields of the Options instance stored in the base::.Options list. If no Options instance is present in the base::.Options list, a new one is created.

The set_default_options() function is used to set the default options values for the parabar package. The function is automatically called at package load and the entry created can be retrieved via getOption("parabar"). Specific package options can be retrieved using the helper function get_option().

Usage

get_option(option)

set_option(option, value)

set_default_options()

Arguments

option

A character string representing the name of the option to retrieve or adjust. See the public fields of R6::R6 class Options for the list of available parabar options.

value

The value to set the option to.

Value

The get_option() function returns the value of the requested option present in the base::.Options list, or its corresponding default value (i.e., see Options). If the requested option is not known, an error is thrown.

The set_option() function returns void. It throws an error if the requested option to be adjusted is not known.

The set_default_options() function returns void. The options set can be consulted via the base::.Options list. See the Options R6::R6 class for more information on the default values set by this function.

See also

Options, set_default_options(), base::options(), and base::getOption().

Examples

# Get the status of progress tracking.
get_option("progress_track")
#> [1] TRUE

# Set the status of progress tracking to `FALSE`.
set_option("progress_track", FALSE)

# Get the status of progress tracking again.
get_option("progress_track")
#> [1] FALSE

# Restore default options.
set_default_options()

# Get the status of progress tracking yet again.
get_option("progress_track")
#> [1] TRUE