View source: R/promote_elements.R
promote_elements | R Documentation |
promote_elements
converts multi-value elements of a list into uniquely
named elements of the [primary] list. [What's a better way to say this?]
promote_elements(x, combine_names = TRUE, recursive = FALSE)
x |
A list. |
If any of the elements of the list had multiple value, these values will now be included as separate elements in the top level.
mylist <- list("A" = 1, "B" = c(1,2,4), "C" = letters[1:5], "D" = list(10:20, fruit = c("orange", "apple", "banana"))) mylist promote_elements(mylist) # The following two lines are equivalent for this example: promote_elements(promote_elements(mylist)) promote_elements(mylist, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.