Description Usage Arguments Value Author(s) References See Also Examples
See generic: existsNested
1 2 3 | ## S4 method for signature 'character,environment'
existsNested(id, where = parent.frame(),
strict = c(0, 1, 2), ...)
|
id |
|
where |
|
strict |
|
... |
Further arguments to be passed to subsequent functions/methods. |
logical
.
TRUE
: component exists;
TRUE
: component does not exist;
Janko Thyson janko.thyson@rappster.de
http://github.com/Rappster/nestr
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 | ## Not run:
##------------------------------------------------------------------------------
## Basics //
##------------------------------------------------------------------------------
setNested(id = "test", value = TRUE)
existsNested(id = "test")
setNested(id = "a/b/c", value = 10)
existsNested(id = "a")
existsNested(id = "a/b")
existsNested(id = "a/b/c")
existsNested(id = "a/b/c/d")
existsNested(id = "c")
existsNested(id = "c/d/e")
##------------------------------------------------------------------------------
## Strictness levels //
##------------------------------------------------------------------------------
## Empty ID //
existsNested(id = character())
try(existsNested(id = character(), strict = 1))
try(existsNested(id = character(), strict = 2))
## Not-existing //
existsNested(id = "c/d/e")
try(existsNested(id = "c/d/e", strict = 1))
try(existsNested(id = "c/d/e", strict = 2))
##------------------------------------------------------------------------------
## Explicit `where` //
##------------------------------------------------------------------------------
where <- new.env()
setNested(id = "a/b/c", value = 10, where = where)
existsNested(id = "a/b/c", where = where)
existsNested(id = "a/b/c/d", where = where)
existsNested(id = "c/d/e", where = where)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.