insert {clustComp} | R Documentation |
insert
introduces a vector at a given position of another vector,
displacing to the right all values from that position onwards.
insert(vect, position, value)
vect |
the vector in which to insert additional values. |
position |
the position of vector |
value |
the values to be inserted in the vector |
The value of position
does not need to be a number smaller
than or equal to the length of vect
, as the missing values will be
denoted as NA.
new.vector |
the vector resulting after inserting |
Aurora Torrente aurora@ebi.ac.uk and Alvis Brazma brazma@ebi.ac.uk
# simulated data v1 <- 1:10 v2 <- insert(v1, 4, 0) v2 <- insert(v1, 1, rep(0, 5)) v2 <- insert(v1, 11, "A") v2 <- insert(v1, 12, "A")