Prepend a vector.
This is a companion to
append() to help merging
two lists or atomic vectors.
prepend() is a clearer semantic
signal than `c()` that a vector is to be merged at the beginning of
another, especially in a pipe chain.
prepend(x, values, before = 1)
- the vector to be modified.
- to be included in the modified vector.
- a subscript, before which the values are to be appended.
A merged vector.
x <- as.list(1:3) append(x, "a") prepend(x, "a") prepend(x, list("a", "b"), before = 3)
Looks like there are no examples yet.