Skip to contents

Insert values at a position

Usage

insert(x, positions, values)

Arguments

x

A vector of values

positions

Integer of positions of x to insert values

values

A vector of values to insert into x

Value

A vector with the intended values inserted

Examples

insert(letters[1:5], c(2, 4), c("X", "Y"))
#> [1] "a" "X" "b" "c" "Y" "d" "e"