insert {omnibus} | R Documentation |
Insert values into a vector
Description
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)
Arguments
x |
Vector of numeric, integer, character, or other values of the class of |
into |
Vector of values into which to insert |
at |
Vector of positions (indices) where |
warn |
If |
Value
Vector.
See Also
Examples
x <- -1:-3
into <- 10:20
at <- c(1, 3, 14)
insert(x, into, at)
insert(-1, into, at)
[Package omnibus version 1.2.13 Index]