Learn R Programming

xpose.xtras (version 0.2.2)

get_xtras_option: Inspect which xpose.xtras option value is dominant

Description

For the two "two-tier" options -- default_labs and default_watermark, which can be set both as a session-wide R option (via set_xtras_options()) and per-xpdb (via set_default_labs() / set_default_watermark()) -- reports the value at each tier and which one is dominant, i.e. would currently be used by apply_default_labs() / add_watermark() absent any argument passed directly to those functions (which always takes precedence over both tiers).

The other options recognized by set_xtras_options() (save_dir, save_width, save_height, gg_theme, xp_theme) have no xpdb-level tier to compare against (see the Details in set_xtras_options()), so for those xpdb is always NULL and dominant is "option" or "neither".

Usage

get_xtras_option(name, xpdb = NULL)

Value

a list with elements option (the getOption() value), xpdb (the xpdb-level value, or NULL), and dominant (one of "option", "xpdb", or "neither")

Arguments

name

<character> One of the option names recognized by set_xtras_options()

xpdb

<xpose_data> or <xp_xtras> object to check for an xpdb-level value (optional; only consulted for default_labs/default_watermark)

Examples

Run this code
options(xpose.xtras.default_labs = list(caption = "session default"))
xpdb_x2 <- set_default_labs(xpdb_x, caption = "model-specific")
get_xtras_option("default_labs", xpdb_x2)
options(xpose.xtras.default_labs = NULL)

Run the code above in your browser using DataLab