enlargeVector: Enlarge a Vector to Given Length

View source: R/vector.R

enlargeVectorR Documentation

Enlarge a Vector to Given Length

Description

Enlarge a vector to the given length, filling with given element

Usage

enlargeVector(x, length.out, fill.with = "")

Arguments

x

vector

length.out

desired length of output vector

fill.with

element to fill the vector up with (default: "")

Value

x, filled up with fill.with to a final length of length.out

Examples

kwb.utils::enlargeVector(1:5, 10, fill.with = 0) 
kwb.utils::enlargeVector(1:5, 10, fill.with = NA) 
kwb.utils::enlargeVector(c("a", "b", "c"), 10) 
kwb.utils::enlargeVector(c("a", "b", "c"), 10, fill.with = "?")


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.