View source: R/dataInitialization.R
initV | R Documentation |
This function initializes a vector based on a specified type and size, with an optional initial value.
initV(typeFunc, x, initVal = NULL)
typeFunc |
A character string indicating the type of the vector or a function to create the vector. |
x |
The length of the vector. |
initVal |
An optional initial value to fill the vector. |
A vector of the specified type and size, optionally initialized with a value.
# Create a numeric vector of length 5
initV("numeric", 5)
# Create a logical vector of length 3 initialized with TRUE
initV("logical", 3, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.