View source: R/S03_Utilities.R
add_to_list | R Documentation |
A function that adds a new element to a pre-existing list. Allows greater compatibility with the pipe operator.
add_to_list(l, name, e)
l |
A list. |
name |
A character string, the name of the new element being added. |
e |
An R object, the new element to add to the list. |
A list with an additional element e
with the specified name.
l <- list() |>
add_to_list( 'A', 1:3 ) |>
add_to_list( 'B', list( C = 1, D = 2 ) )
print(l)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.