Description Usage Arguments Author(s) References See Also Examples
Retrieves actual values based on their level
.
1 2 |
input |
Signature argument. Object containing structure information. |
value |
|
outer |
|
resolve |
|
strict |
|
... |
Further arguments to be passed to subsequent functions/methods. |
Janko Thyson janko.thyson@rappster.de
http://github.com/rappster/listr
getByLevel-list-method,
getStructure
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 | ## Not run:
input <- list(
x1 = list(x11 = list(x111 = list(x1111 = 1, x1112 = 2), x112 = 1),
x12 = list(x121 = 1, x122 = 1)),
x2 = list(x21 = "x21"),
x3 = list("x31"),
x4 = "x4",
x5 = list(1:3),
list(list(1, 2), list(3, 4)),
list(1:3),
"char 1",
"char 2",
letters[1:3],
c(1,3,5),
TRUE,
new.env(),
data.frame(x = 1:3, y = 1:3)
)
## Inspect structure //
(struc <- getStructure(input))
getByLevel(input, value = 1)
getByLevel(input, value = 1, resolve = TRUE)
getByLevel(input, value = 2)
getByLevel(input, value = 2, resolve = TRUE)
getByLevel(input, value = 3)
getByLevel(input, value = 3, resolve = TRUE)
getByLevel(input, value = 4)
getByLevel(input, value = 4, resolve = TRUE)
## Condition handling //
getByLevel(input, value = 5)
try(getByLevel(input, value = 5, strict = 1))
try(getByLevel(input, value = 5, strict = 2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.