Description Usage Arguments Value Author(s) References See Also Examples
See generic: rmMetaValue
1 2 3 4 5 |
id |
|
where |
|
sub_id |
|
strict |
|
... |
Further arguments to be passed to subsequent functions/methods. |
ANY
. Component value or for invalid argument input
and non-existing component the value of default
unless
strict == 1
in which case a warning is issued or
strict == 2
in which case an error is thrown.
Janko Thyson janko.thyson@gmail.com
http://github.com/Rappster/optionr
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ## Not run:
##------------------------------------------------------------------------------
## Default `where` //
##------------------------------------------------------------------------------
container <- initializeOptionContainer(overwrite = TRUE)
setMetaValue(id = "a", value = TRUE)
rmMetaValue(id = "a")
exists("a", container$.meta, inherits = FALSE)
setMetaValue(id = "a/b/c", value = 10)
rmMetaValue(id = "a/b/c")
exists("c", container$.meta$a$b, inherits = FALSE)
##------------------------------------------------------------------------------
## Different `where` //
##------------------------------------------------------------------------------
where <- "test"
container <- initializeOptionContainer(id = where, overwrite = TRUE)
".test" %in% names(options())
setMetaValue(id = "a/b/c", value = 10, where = where)
rmMetaValue(id = "a/b/c", where = where)
exists("c", container$.meta$a$b, inherits = FALSE)
where <- structure(list(id = "test"), class = "OptionContext.Test")
container <- initializeOptionContainer(id = where, overwrite = TRUE)
".test" %in% names(options())
setMetaValue(id = "a/b/c", value = 10, where = where)
rmMetaValue(id = "a/b/c", where = where)
exists("c", container$.meta$a$b, inherits = FALSE)
##------------------------------------------------------------------------------
## Strictness //
##------------------------------------------------------------------------------
container <- initializeOptionContainer(overwrite = TRUE)
rmMetaValue(id = "a")
try(rmMetaValue(id = "a", strict = 2))
rmMetaValue(id = "a/b/c")
try(rmMetaValue(id = "a/b/c", strict = 2))
rmMetaValue(id = character())
try(rmMetaValue(id = character(), strict = 2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.