Insert an element into a vector.
insert(elem, slot, v)
elem | element to insert |
---|---|
slot | location of insert |
v | vector to insert into |
vector with element inserted
insert(2, 1, 1)#> [1] 2 1insert(2, 2, 1)#> [1] 1 2insert('x', 5, letters)#> [1] "a" "b" "c" "d" "x" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" #> [20] "s" "t" "u" "v" "w" "x" "y" "z"