Learn R Programming

mark (version 0.8.1)

insert: Insert

Description

Insert values at a position

Usage

insert(x, positions, values)

Value

A vector with the intended values inserted

Arguments

x

A vector of values

positions

Integer of positions of x to insert values

values

A vector of values to insert into x

Examples

Run this code
insert(letters[1:5], c(2, 4), c("X", "Y"))

Run the code above in your browser using DataLab