Description Usage Arguments Details Value Examples
Simplify a list of lists by eliminating the top-level list.
1 | simplify_lst_lst(lst, unnamed_prefix = "name")
|
lst |
a list of lists, each of which should be moved up one level in the list hierarchy. |
unnamed_prefix |
character: string to use as a prefix for naming unnamed list items in the event that any list items are unnamed. |
List names are handled as follows: if any list items are named, these names
will be set in the returned list. If any list items are unnamed, their names
will be set to the default value prefixed by unnamed_prefix
with an
integer suffix starting at 1 and incremented for each unnamed item.
list: the items in lst
but each moved one level up in the list
hierarchy, resulting in a list of single elements.
1 2 3 4 5 6 7 8 9 10 11 | a_1 <- "pineapple"
a_2 <- list(uno = 1, due = 2, tre = 3)
a_3 <- c(1, 4, 9, 16, 25)
lst <- list(list(z_1 = a_1), list(z_2 = a_2), list(z_3 = a_3))
simplify_lst_lst(lst)
a_1 <- "pineapple"
a_2 <- list(uno = 1, due = 2, tre = 3)
a_3 <- c(1, 4, 9, 16, 25)
lst <- list(list(a_1), list(z = a_2), list(a_3))
simplify_lst_lst(lst)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.