Description Usage Arguments Details Value See Also Examples
get_option
allows for deep-inspection of Global Options. The problem
with base::getOption
is that retrieves options
by name only. This make is difficult to work with deeply layered options and
promotes package developers to create top-level global options like
data.table.xxx
rather than using data.table$xxx
base::getOption
1 | get_option(x, default = NULL)
|
x |
character or unquoted expression for retrieving the option |
default |
if the specified option is not set in the options list, this value is returned. This facilitates retrieving an option and checking whether it is set and setting it separately if not. |
Lazy, drop-in replacement for base::getOption
that allows for deep
retrieval rather than access by name alone
The current value for option x
or NULL
if unset.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | set_option( foo = list( bar="baz" ) )
get_option('foo')
get_option(foo) # same, unquoted
# DEEP RETRIEVAL
get_option(foo$bar) # "baz"
get_option( foo[['bar']] ) # "baz"
set_option( lets = letters[1:5] )
get_option( lets[1:5] )
# USES DEFAULT
get_option(xdx$ydy, default="default") # does not exist, e.g.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.