powered by
Move elements from one list to another list by reference.
splice(x, y, x_position, y_from, y_to)
Invisibly returns NULL.
NULL
A CppList object to which to add elements.
A CppList object, of the same data type as x, from which to extract elements.
x
Index at which to insert elements in x.
Index of the first element to extract from y.
y
Index of the last element to extract from y.
merge, splice_after.
x <- cpp_list(4:9) x # 4 5 6 7 8 9 y <- cpp_list(10:12) y # 10 11 12 splice(x, y, 3, 2, 3) x # 4 5 11 12 6 7 8 9 y # 10
Run the code above in your browser using DataLab