named_list | R Documentation |
Not infrequently, you might find yourself writing things like list(var1 = var1, var2 = var2)
.
This function makes this easier by creating a list with items named based on the variables
passed into it.
named_list(...)
... |
One or more variables to be included into a list. Note that you can pass values as well, but they are then used as both the name and the value of the respective list item. |
A named list, with names taken from the variable names in the input
name <- "Paul"
age <- 10
named_list(name, age)
# Note that this can be combined with named arguments
named_list(name, age, place = "Berlin")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.