View source: R/add_list_null.R
add_list_null | R Documentation |
list(NULL)
to an existing list in place of absent elementsThis function adds list(NULL)
to a list at all the elements in a user-supplied vector that are NULL
.
add_list_null(l, elm)
l |
A list. |
elm |
A character vector which defines list element names at which the function should check whether those elements exist and, if not, replace them with |
A list, exactly as inputted, but in which NULL
elements have been replaced by list(NULL)
.
Edward Lavender
l <- list(a = 10, b = 5, c = 4, d = NULL)
add_list_null(l, "d")
add_list_null(l, "e")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.