option: option

Description Usage Arguments Note References See Also Examples

View source: R/option.R

Description

Get or set a single option

Usage

1

Arguments

...

quoted or unquoted name -OR- name = value expression used to set the option

option gets the argument if it is a single quoted or unquoted name. If the argument is a name = value pair, the option with the name is set.

Unlike get_option, option does not support a default argument.

Note

Though it might be desirous to set options wih syntax like: option(x) <- 5 this is not currently possible due to how the R works. This is discussed at length at Stack Overflow:
http://stackoverflow.com/questions/15252537/why-are-arguments-to-replacement-functions-not-evaluated-lazily

References

http://stackoverflow.com/questions/15252537/why-are-arguments-to-replacement-functions-not-evaluated-lazily

See Also

set_option
get_option

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# option(xdx) <- 10  # does not work
  set_option(foo="bar")

  option(foo)
  option(baz)          # NULL, MISSING
  option(NA)           # NA, BY DEFINITION

  # NOT IMPLEMENTED YET:
  # option( foo=1 )
  # option( foo$bar=1 ) # DEEP ASSIGNMENT

decisionpatterns/options documentation built on May 12, 2017, 9:56 p.m.