pad.na | R Documentation |
This function fills up a vector to a given length by appending NA-values at the end. If the input vector's length is less than the provided length, the function pads the vector with NA. If the vector's length is already equal to or greater than the given length, no change will be made.
pad.na(x, len)
x |
A vector that needs to be padded with NA. This can be of any type (numeric, etc.) |
len |
The target length for the vector. If the provided length is less than the length of the input vector, the function does not make any change to the input vector. |
Returns a vector of the same type as the input, but with its length adjusted to the specified len, padding with NA values at the end if necessary.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.