insert {textutils} | R Documentation |
Vector Insertion
Description
Insert elements into a vector.
Usage
insert(x, values, before.index)
Arguments
x |
a vector |
values |
elements to insert |
before.index |
numeric: before which positions of the original vector to insert the new elements |
Details
Inserts elements into a vector.
Value
A vector with values
inserted. If either
values
or before.index
are of length
zero, the original vector is returned.
Author(s)
Enrico Schumann
See Also
Examples
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"
[Package textutils version 0.4-1 Index]