insertvec function

Insert a set of values in a vector

Insert a set of values in a vector

Inserting values in a vector at specific index locations

insertvec(v, ind, val)

Arguments

  • v: vector
  • ind: ndex locations where val is inserted
  • val: some vector of insertion, maybe NA

Details

The vector is parsed out and val values are inserted where after the index values provided.

Returns

  • v: new vector with val inserted after the index

Author(s)

Jonathan M. Leesjonathan.lees@unc.edu

Examples

x = 1:20 insertvec(x, c(4,17) , NA)
  • Maintainer: Jonathan M. Lees
  • License: GPL (>= 2)
  • Last published: 2024-07-09

Useful links