View source: R/dataInitialization.R
initList | R Documentation |
This function initializes a list based on size or names, with an optional initial value.
initList(x = NULL, initVal = NULL)
x |
A character vector as names, or an numeric indicating the size of the list. |
initVal |
an optional initial value for all elements of the list. |
A list of the specified size and names, optionally initialized with a value.
# Create a list with 3 elements
initList(3)
# Create a named list initialized with NULL
initList(c("a", "b", "c"))
# Create a list with 2 elements initialized with 0
initList(2, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.