Description Usage Arguments Details Examples
Add an empty list to a list at a position specified by a character vector,
which is interpreted recursively. See Examples
.
1 | expand_list(.list, position)
|
.list |
A list. |
position |
A character vector. |
'[['
allows indexing a list with a vector, but only
if the indices are already present in the list. expand_list
implements
an easy way to equip a list with the needed indices.
1 2 3 4 5 6 7 | l <- list()
# Add empty list "a" on top level
l <- expand_list(l, "a")
# Add list "b" on top level with empty list "c" inside it
l <- expand_list(l, c("b", "c"))
# Add empty list "d" to the previously defined list "b"
l <- expand_list(l, c("b", "d"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.