
Append NA values to a vector to reach a target length
pad_with_nas.RdThis function pads a vector at the tail with NA values, to achieve a
specified length target.
Value
A vector of length target_length where its first length(vec)
elements are identical to vec. The remain tail elements are NA.
Examples
# Pad a vector with NA values to reach a target length of 10
pad_with_nas(c(1, 2, 3), 10)
#> [1] 1 2 3 NA NA NA NA NA NA NA