Description Usage Arguments Value Author(s) References See Also Examples
See generic: fromList
1 2 3 | ## S4 method for signature 'list,missing'
fromList(input, where = parent.frame(),
strict = FALSE, ...)
|
input |
|
where |
|
strict |
|
... |
Further arguments to be passed to subsequent functions/methods. |
See method
fromList-char-char-method
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 45 46 47 48 49 50 51 52 53 54 55 | ## Not run:
##------------------------------------------------------------------------------
## In parent frame //
##------------------------------------------------------------------------------
input <- list(
europe = list(germany = list(berlin = 1, hamburg = 2, munich = 3)),
america = list(usa = list(wisconsin = list(madison = 1))),
south.america = 1,
as.list(1:3)
)
res <- fromList(input = input)
res
ls(res)
ls(europe)
ls(europe$germany)
getNested("europe/germany/berlin")
ls(res$"[4]")
getNested("[4]/[1]")
getNested("[4]/[2]")
getNested("[4]/[3]")
##------------------------------------------------------------------------------
## In custom environment //
##------------------------------------------------------------------------------
input <- list(
europe = list(germany = list(berlin = 1, hamburg = 2, munich = 3)),
america = list(usa = list(wisconsin = list(madison = 1))),
south.america = 1,
as.list(1:3)
)
where <- new.env()
res <- fromList(input = input, where = where)
identical(res, where)
## A bit more convenient //
where <- fromList(input = input, where = new.env())
ls(where$europe)
ls(where$europe$germany)
getNested("where/europe/germany/berlin")
getNested("europe/germany/berlin", where = where)
ls(where$"[4]")
getNested("[4]/[1]", where = where)
getNested("[4]/[2]", where = where)
getNested("[4]/[3]", where = where)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.