getOptionContainer-character-method: Get Option Container (char)

Description Usage Arguments Value Author(s) References See Also Examples

Description

See generic: getOptionContainer

Usage

1
2
3
4
  ## S4 method for signature 'character'
getOptionContainer(id = tryCatch(devtools::as.package(".")$package,
  error = function(cond) {     stop("Invalid default value for `id`") }),
  hidden = TRUE, ...)

Arguments

id

character.

hidden

logical. TRUE: make sure name/ID information in id is preprended with a dot as the container was assigned with hidden = TRUE; FALSE: use name/ID information in id as is.

...

Further arguments to be passed to subsequent functions/methods.

Value

logical. TRUE.

Author(s)

Janko Thyson janko.thyson@gmail.com

References

http://github.com/Rappster/optionr

See Also

getOptionContainer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 

##------------------------------------------------------------------------------
## Default `id` //
##------------------------------------------------------------------------------

res <- ensureOptionContainer(overwrite = TRUE)
identical(getOptionContainer(), res)
options(".optionr" = NULL)
  
##------------------------------------------------------------------------------
## Hidden //
##------------------------------------------------------------------------------

res <- ensureOptionContainer(hidden = FALSE, overwrite = TRUE)
identical(getOptionContainer(hidden = FALSE), res)
options("optionr" = NULL)
  
##------------------------------------------------------------------------------
## As interface //
##------------------------------------------------------------------------------
  
id <- structure(list(id = "test"), class = "OptionContext.Test")
res <- ensureOptionContainer(id, hidden = FALSE, overwrite = TRUE)
identical(getOptionContainer(id, hidden = FALSE), res)
options("test" = NULL)
  

## End(Not run)

rappster/optionr documentation built on May 26, 2019, 11:23 p.m.