Enlarge a vector to the given length, filling with given element
Arguments
- x
vector
- length.out
desired length of output vector
- fill.with
element to fill the vector up with (default: "")
Examples
kwb.utils::enlargeVector(1:5, 10, fill.with = 0)
#> [1] 1 2 3 4 5 0 0 0 0 0
kwb.utils::enlargeVector(1:5, 10, fill.with = NA)
#> [1] 1 2 3 4 5 NA NA NA NA NA
kwb.utils::enlargeVector(c("a", "b", "c"), 10)
#> [1] "a" "b" "c" "" "" "" "" "" "" ""
kwb.utils::enlargeVector(c("a", "b", "c"), 10, fill.with = "?")
#> [1] "a" "b" "c" "?" "?" "?" "?" "?" "?" "?"