powered by
Insert elements into a vector.
insert(x, values, before.index)
A vector with values inserted. If either
values
values or before.index are of length zero, the original vector is returned.
before.index
a vector
elements to insert
numeric: before which positions of the original vector to insert the new elements
Enrico Schumann
Inserts elements into a vector.
append
x <- letters[1:5] ## [1] "a" "b" "c" "d" "e" insert(x, values = "Z", c(2, 5)) ## [1] "a" "Z" "b" "c" "d" "Z" "e"
Run the code above in your browser using DataLab