Move elements to the start of a vector
moveToFront(x, elements)
x | vector |
---|---|
elements | elements out of |
vector with elements
coming first
moveToFront(1:10, 5)#> [1] 5 1 2 3 4 6 7 8 9 10moveToFront(c("a", "b", "c", "x", "y", "d"), c("x", "y"))#> [1] "x" "y" "a" "b" "c" "d"