inject: Inject (insert) values at positions in a vector

View source: R/misc.R

injectR Documentation

Inject (insert) values at positions in a vector

Description

Inject (insert) values at positions in a vector

Usage

inject(what, inWhat, at)

Arguments

what

The values to inject

inWhat

The vector in which to inject them

at

The positions in the vector *after* which to inject the values.

Value

A vector of same mode at 'inWhat', and of length equal to the sum of the lengths of 'what' and 'inWhat'.

Examples

inWhat <- 1:10
inject(c(21,22,23), inWhat, at=as.integer(c(0,5,10)))

ETHZ-INS/epiwraps documentation built on Oct. 27, 2024, 8:02 p.m.