Learn R Programming

GEOmap (version 2.5-11)

insertvec: Insert a set of values in a vector

Description

Inserting values in a vector at specific index locations

Usage

insertvec(v, ind, val)

Value

v

new vector with val inserted after the index

Arguments

v

vector

ind

ndex locations where val is inserted

val

some vector of insertion, maybe NA

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

Details

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

Examples

Run this code
  x = 1:20

 insertvec(x, c(4,17) , NA)

Run the code above in your browser using DataLab