This function inserts values into a vector, lengthening the overall vector. It is different from, say, x[1:3] <- c('a', 'b', 'c') which simply replaces the values at indices 1 through 3.
Usage
insert(x, into, at, warn = TRUE)
Value
Vector.
Arguments
x
Vector of numeric, integer, character, or other values of the class of x to be inserted.
into
Vector of values into which to insert x.
at
Vector of positions (indices) where x should be inserted. If the length of x is shorter than the length of at, then values in x will be recycled and a warning produced.