insert | R Documentation |
Generic function that inserts an item into a vector at a specified position.
insert(v, e, pos)
v |
vector into which an item is to be inserted. |
e |
element to insert. |
pos |
numeric. Position index at which element |
A vector. If original vector v
and element e
are numeric, a numeric vector is returned. Otherwise, a character vector is returned.
Jason Grafmiller
abc <- letters[1:10]; class(abc)
insert(abc, "Inserted", 5)
n <- 1:10; class(n)
insert(n, 2000, 5)
insert(abc, 2000, 5)
insert(n, "ABC", 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.