| xplain_opt | R Documentation |
Get or set package-level options for xplainfi.
xplain_opt(...)
... |
Option names to retrieve (as character strings) or options to set (as named arguments).
|
Options can be set in three ways (in order of precedence):
Using xplain_opt(option_name = value) (recommended)
Using options("xplain.option_name" = value)
Using environment variables XPLAIN_OPTION_NAME=value
| Option | Default | Description |
verbose | TRUE | Show informational messages (e.g., when using default measure or resampling) |
progress | FALSE | Show progress bars during computation |
sequential | FALSE | Force sequential execution (disable parallelization) |
debug | FALSE | Enable debug output for development and troubleshooting |
When getting a single option: the option value (logical)
When getting multiple options: a named list of option values
When setting options: the previous values (invisibly)
# Get current value of an option
xplain_opt("verbose")
# Get all options
xplain_opt()
# Set an option (returns previous value invisibly)
old <- xplain_opt(verbose = FALSE)
xplain_opt("verbose") # Now FALSE
# Restore previous value
xplain_opt(verbose = old$verbose)
# Temporary option change with withr
if (requireNamespace("withr", quietly = TRUE)) {
withr::with_options(
list("xplain.verbose" = FALSE),
{
# Code here runs with verbose = FALSE
xplain_opt("verbose")
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.